-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Loosen dependency * Move to new release scheme * Change caching in CI * Save data cache after running tests * Don't use download tests in CI
- Loading branch information
Showing
9 changed files
with
950 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [0.1.1] - 2023-03-27 | ||
|
||
### Fixed | ||
|
||
- Loosen python dependency | ||
|
||
[0.1.1]: https://github.com/dobraczka/sylloge/releases/tag/v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from pathlib import Path | ||
from typing import Iterable, Union | ||
|
||
import pandas as pd | ||
from strawman import dummy_df, dummy_triples | ||
from util import DatasetStatistics | ||
|
||
from sylloge.base import EA_SIDE_LEFT, EA_SIDE_RIGHT, EA_SIDES | ||
|
||
|
||
class DataPathMocker: | ||
def __init__(self, data_path): | ||
self.data_path = data_path | ||
|
||
def mock_data_path(self): | ||
return self.data_path | ||
|
||
|
||
class ResourceMocker: | ||
def __init__(self, statistic: DatasetStatistics, fraction: float): | ||
self.statistic = statistic | ||
self.fraction = fraction | ||
|
||
def mock_read(self, path: str, names: Iterable): | ||
return self.mock_read_zipfile_csv(path="", inner_path=path) | ||
|
||
def mock_read_zipfile_csv( | ||
self, path: Union[str, Path], inner_path: str, sep: str = "\t", **kwargs | ||
) -> pd.DataFrame: | ||
if "rel_triples_1" in inner_path: | ||
return dummy_triples( | ||
int(self.statistic.num_rel_triples_left * self.fraction), | ||
entity_prefix=EA_SIDE_LEFT, | ||
) | ||
elif "rel_triples_2" in inner_path: | ||
return dummy_triples( | ||
int(self.statistic.num_rel_triples_right * self.fraction), | ||
entity_prefix=EA_SIDE_RIGHT, | ||
) | ||
elif "attr_triples_1" in inner_path: | ||
return dummy_triples( | ||
int(self.statistic.num_attr_triples_left * self.fraction), | ||
entity_prefix=EA_SIDE_LEFT, | ||
relation_triples=False, | ||
) | ||
elif "attr_triples_2" in inner_path: | ||
return dummy_triples( | ||
int(self.statistic.num_attr_triples_right * self.fraction), | ||
entity_prefix=EA_SIDE_RIGHT, | ||
relation_triples=False, | ||
) | ||
elif "_links" in inner_path: | ||
return dummy_df( | ||
shape=(int(self.statistic.num_ent_links * self.fraction), 2), | ||
content_length=100, | ||
columns=list(EA_SIDES), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters