hafnia 0.1.14__tar.gz → 0.1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {hafnia-0.1.14 → hafnia-0.1.16}/PKG-INFO +2 -1
  2. {hafnia-0.1.14 → hafnia-0.1.16}/pyproject.toml +2 -1
  3. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/experiment_cmds.py +26 -0
  4. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/torch_helpers.py +0 -1
  5. {hafnia-0.1.14 → hafnia-0.1.16}/uv.lock +3 -1
  6. {hafnia-0.1.14 → hafnia-0.1.16}/.devcontainer/devcontainer.json +0 -0
  7. {hafnia-0.1.14 → hafnia-0.1.16}/.devcontainer/hooks/post_create +0 -0
  8. {hafnia-0.1.14 → hafnia-0.1.16}/.github/dependabot.yaml +0 -0
  9. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/Dockerfile +0 -0
  10. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/build.yaml +0 -0
  11. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/ci_cd.yaml +0 -0
  12. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/lint.yaml +0 -0
  13. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/publish_docker.yaml +0 -0
  14. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/publish_pypi.yaml +0 -0
  15. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/publish_release.yaml +0 -0
  16. {hafnia-0.1.14 → hafnia-0.1.16}/.github/workflows/tests.yaml +0 -0
  17. {hafnia-0.1.14 → hafnia-0.1.16}/.gitignore +0 -0
  18. {hafnia-0.1.14 → hafnia-0.1.16}/.pre-commit-config.yaml +0 -0
  19. {hafnia-0.1.14 → hafnia-0.1.16}/.python-version +0 -0
  20. {hafnia-0.1.14 → hafnia-0.1.16}/.vscode/extensions.json +0 -0
  21. {hafnia-0.1.14 → hafnia-0.1.16}/.vscode/launch.json +0 -0
  22. {hafnia-0.1.14 → hafnia-0.1.16}/.vscode/settings.json +0 -0
  23. {hafnia-0.1.14 → hafnia-0.1.16}/LICENSE +0 -0
  24. {hafnia-0.1.14 → hafnia-0.1.16}/README.md +0 -0
  25. {hafnia-0.1.14 → hafnia-0.1.16}/docs/cli.md +0 -0
  26. {hafnia-0.1.14 → hafnia-0.1.16}/docs/release.md +0 -0
  27. {hafnia-0.1.14 → hafnia-0.1.16}/docs/s2m.md +0 -0
  28. {hafnia-0.1.14 → hafnia-0.1.16}/examples/dataset_builder.py +0 -0
  29. {hafnia-0.1.14 → hafnia-0.1.16}/examples/example_load_dataset.py +0 -0
  30. {hafnia-0.1.14 → hafnia-0.1.16}/examples/example_logger.py +0 -0
  31. {hafnia-0.1.14 → hafnia-0.1.16}/examples/example_torchvision_dataloader.py +0 -0
  32. {hafnia-0.1.14 → hafnia-0.1.16}/examples/script2model/pytorch/Dockerfile +0 -0
  33. {hafnia-0.1.14 → hafnia-0.1.16}/examples/script2model/pytorch/src/lib/train_utils.py +0 -0
  34. {hafnia-0.1.14 → hafnia-0.1.16}/examples/script2model/pytorch/src/scripts/train.py +0 -0
  35. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/__init__.py +0 -0
  36. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/__main__.py +0 -0
  37. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/config.py +0 -0
  38. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/consts.py +0 -0
  39. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/data_cmds.py +0 -0
  40. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/profile_cmds.py +0 -0
  41. {hafnia-0.1.14 → hafnia-0.1.16}/src/cli/runc_cmds.py +0 -0
  42. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/__init__.py +0 -0
  43. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/data/__init__.py +0 -0
  44. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/data/factory.py +0 -0
  45. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/experiment/__init__.py +0 -0
  46. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/experiment/hafnia_logger.py +0 -0
  47. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/http.py +0 -0
  48. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/log.py +0 -0
  49. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/__init__.py +0 -0
  50. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/api.py +0 -0
  51. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/builder.py +0 -0
  52. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/download.py +0 -0
  53. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/executor.py +0 -0
  54. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/platform/experiment.py +0 -0
  55. {hafnia-0.1.14 → hafnia-0.1.16}/src/hafnia/utils.py +0 -0
  56. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_builder.py +0 -0
  57. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_check_example_scripts.py +0 -0
  58. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_cli.py +0 -0
  59. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_executor.py +0 -0
  60. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_mdi_logger.py +0 -0
  61. {hafnia-0.1.14 → hafnia-0.1.16}/tests/test_samples.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hafnia
3
- Version: 0.1.14
3
+ Version: 0.1.16
4
4
  Summary: Python tools for communication with Hafnia platform.
5
5
  Author-email: Ivan Sahumbaiev <ivsa@milestone.dk>
6
6
  License-File: LICENSE
@@ -8,6 +8,7 @@ Requires-Python: >=3.10
8
8
  Requires-Dist: boto3>=1.35.91
9
9
  Requires-Dist: click>=8.1.8
10
10
  Requires-Dist: datasets>=3.2.0
11
+ Requires-Dist: flatten-dict>=0.4.2
11
12
  Requires-Dist: pillow>=11.1.0
12
13
  Requires-Dist: pyarrow>=18.1.0
13
14
  Requires-Dist: pydantic>=2.10.4
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hafnia"
3
- version = "0.1.14"
3
+ version = "0.1.16"
4
4
  description = "Python tools for communication with Hafnia platform."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Ivan Sahumbaiev", email = "ivsa@milestone.dk" }]
@@ -9,6 +9,7 @@ dependencies = [
9
9
  "boto3>=1.35.91",
10
10
  "click>=8.1.8",
11
11
  "datasets>=3.2.0",
12
+ "flatten-dict>=0.4.2",
12
13
  "pillow>=11.1.0",
13
14
  "pyarrow>=18.1.0",
14
15
  "pydantic>=2.10.4",
@@ -13,6 +13,32 @@ def experiment() -> None:
13
13
  pass
14
14
 
15
15
 
16
+ @experiment.command(name="create_recipe")
17
+ @click.option("--source_folder", default=".", type=Path, help="Path to the source folder", show_default=True)
18
+ @click.option(
19
+ "--recipe_filename",
20
+ default="recipe.zip",
21
+ type=Path,
22
+ help="Recipe filename. Should have a '.zip' suffix",
23
+ show_default=True,
24
+ )
25
+ def create_recipe(source_folder: str, recipe_filename: str) -> None:
26
+ """Build recipe from local path as image with prefix - localhost"""
27
+
28
+ from hafnia.platform.builder import validate_recipe
29
+ from hafnia.utils import archive_dir
30
+
31
+ path_output_zip = Path(recipe_filename)
32
+
33
+ if path_output_zip.suffix != ".zip":
34
+ raise click.ClickException("Recipe filename must be a '.zip' file")
35
+
36
+ path_source = Path(source_folder)
37
+
38
+ path_output_zip = archive_dir(path_source, path_output_zip)
39
+ validate_recipe(path_output_zip)
40
+
41
+
16
42
  @experiment.command(name="create")
17
43
  @click.argument("name")
18
44
  @click.argument("source_dir", type=Path)
@@ -3,7 +3,6 @@ from typing import List, Optional
3
3
  import datasets
4
4
  import torch
5
5
  import torchvision
6
- import torchvision.transforms.functional
7
6
  from flatten_dict import flatten
8
7
  from PIL import Image, ImageDraw, ImageFont
9
8
  from torchvision import tv_tensors
@@ -549,12 +549,13 @@ http = [
549
549
 
550
550
  [[package]]
551
551
  name = "hafnia"
552
- version = "0.1.14"
552
+ version = "0.1.16"
553
553
  source = { editable = "." }
554
554
  dependencies = [
555
555
  { name = "boto3" },
556
556
  { name = "click" },
557
557
  { name = "datasets" },
558
+ { name = "flatten-dict" },
558
559
  { name = "pillow" },
559
560
  { name = "pyarrow" },
560
561
  { name = "pydantic" },
@@ -585,6 +586,7 @@ requires-dist = [
585
586
  { name = "boto3", specifier = ">=1.35.91" },
586
587
  { name = "click", specifier = ">=8.1.8" },
587
588
  { name = "datasets", specifier = ">=3.2.0" },
589
+ { name = "flatten-dict", specifier = ">=0.4.2" },
588
590
  { name = "flatten-dict", marker = "extra == 'torch'", specifier = ">=0.4.2" },
589
591
  { name = "pillow", specifier = ">=11.1.0" },
590
592
  { name = "pyarrow", specifier = ">=18.1.0" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes