Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • workers/base-worker
1 result
Show changes
Commits on Source (3)
0.3.2-rc1
0.3.2-rc2
......@@ -50,10 +50,14 @@ def create_archive(path: DirPath) -> Tuple[Path, Hash, FileSize, Hash]:
# Create an uncompressed tar archive with all the needed files
# Files hierarchy ifs kept in the archive.
file_list = []
with tarfile.open(path_to_tar_archive, "w") as tar:
tar.add(path)
file_list = [member for member in tar.getnames() if os.path.isfile(member)]
for p in path.glob("**/*"):
x = p.relative_to(path)
tar.add(p, arcname=x, recursive=False)
# Only keep files when computing the hash
if p.is_file():
file_list.append(p)
# Sort by path
file_list.sort()
......
# Classification
::: arkindex_worker.worker.classification
selection:
options:
members: no
::: arkindex_worker.worker.classification.ClassificationMixin
......
# Element
::: arkindex_worker.worker.element
selection:
options:
members:
- ElementType
- MissingTypeError
......
# Entity
::: arkindex_worker.worker.entity
selection:
options:
members:
- EntityType
options:
......
# Metadata
::: arkindex_worker.worker.metadata
selection:
options:
members:
- MetaType
options:
......
# Training
::: arkindex_worker.worker.training
selection:
options:
members:
- DirPath
- Hash
......
# Transcription
::: arkindex_worker.worker.transcription
selection:
options:
members:
- TextOrientation
options:
......
# WorkerVersion
::: arkindex_worker.worker.version
selection:
options:
members: no
options:
show_category_heading: no
......
......@@ -26,7 +26,7 @@ from arkindex_worker.worker import BaseWorker, ElementsWorker
from arkindex_worker.worker.transcription import TextOrientation
FIXTURES_DIR = Path(__file__).resolve().parent / "data"
SAMPLES_DIR = Path("tests") / "samples"
SAMPLES_DIR = Path(__file__).resolve().parent / "samples"
__yaml_cache = {}
......@@ -282,7 +282,7 @@ def model_file_dir():
@pytest.fixture
def model_file_dir_with_subfolder():
return SAMPLES_DIR / "model_files_with_subfolder"
return SAMPLES_DIR / "root_folder"
@pytest.fixture
......
Wow this is actually the data of the best model ever created on Arkindex
\ No newline at end of file
......@@ -56,7 +56,7 @@ def test_create_archive_with_subfolder(model_file_dir_with_subfolder):
):
assert os.path.exists(zst_archive_path), "The archive was not created"
assert (
hash == "e2fa86cefc33b24502ad4151a638dd29"
hash == "3e453881404689e6e125144d2db3e605"
), "Hash was not properly computed"
assert 300 < size < 1500
......