hafnia 0.4.3__py3-none-any.whl → 0.5.1__py3-none-any.whl

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.
@@ -1,27 +1,28 @@
1
1
  hafnia/__init__.py,sha256=0qpjWfVbcfKzLSnfUW6RdclSGkesMQRFS-n_aTJJoSE,179
2
- hafnia/http.py,sha256=bjXbV_3uKbBdudqMdYtnsMttUAsNRMsetYZ4F2xXlEs,3635
2
+ hafnia/http.py,sha256=PkEuanlUKeERABXttaGAJT6hOZ1_B2CwJodbUV4uZdg,3710
3
3
  hafnia/log.py,sha256=sWF8tz78yBtwZ9ddzm19L1MBSBJ3L4G704IGeT1_OEU,784
4
4
  hafnia/torch_helpers.py,sha256=Qj8pV5P8tGw6F3W2Rj9Kel7O8hWuUqiKfTdXd3h5UOo,14080
5
- hafnia/utils.py,sha256=AC4MgF-xkaVrVwKppQ8yZMlTgR3O9Q9ZGeG9sMqd1as,8578
5
+ hafnia/utils.py,sha256=l_awkrb3OttxqSMkPiYcpuP3c_kejkSmiqndSahc1s0,8703
6
6
  hafnia/data/__init__.py,sha256=o9QjiGbEcNa6r-qDmwwmxPXf-1UitNl5-WxFNcujqsg,111
7
7
  hafnia/data/factory.py,sha256=kHkvOtBUbwaShZBGf1kZzocDJBn_1dHHLrQxnUpJmfY,778
8
- hafnia/dataset/dataset_details_uploader.py,sha256=I4hh4-hb8Agpv-o6qekx43dxZ_Lfngbqo6RX1D2DNbU,24854
9
- hafnia/dataset/dataset_helpers.py,sha256=0GbS6PfaiYBulDKRCbd0miN5LHaUIp-XzGt_wZay8xs,5044
10
- hafnia/dataset/dataset_names.py,sha256=5yt5fcotl-uc9aFM4Fp-Z-oNN0N1p9OY3tJ1ujSr1FQ,6601
11
- hafnia/dataset/hafnia_dataset.py,sha256=8RTMolUGgPen-F8IA0kDmxCGl4J5t-eendFZNfSFnsQ,29640
12
- hafnia/dataset/hafnia_dataset_types.py,sha256=aDRdDCBzHlkuY4t1qnCRLP8x_yGF2fCtpIQYmtDIJfA,21193
8
+ hafnia/dataset/dataset_details_uploader.py,sha256=H_zz67bBwbgo4StUwBNmH89WlqydIc-tEQbrRnZDwgg,24161
9
+ hafnia/dataset/dataset_helpers.py,sha256=N8W_ioDlxP2VvNJXzqXLDbcEqgPKz0WyPNOBakHoBUc,6443
10
+ hafnia/dataset/dataset_names.py,sha256=42_UKrDwcKEW48oTbtBaeyi5qVFVaMAj8vRvDv-mcEI,3616
11
+ hafnia/dataset/hafnia_dataset.py,sha256=OOenIMPm8K23AgxHvmc_y05KCzxIwaZa-gv3uNC50NU,38519
12
+ hafnia/dataset/hafnia_dataset_types.py,sha256=eCLawdjIFoul67AAtQ4xaKjbVSNAFA-mvbJYofiu2Sg,26848
13
13
  hafnia/dataset/license_types.py,sha256=b1Jt5e8N89sujIs4T9y39sJEkzpAwCoLDTHDTpkiEOI,2166
14
- hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=CkU61k_qaPSu_4Yo-NArr7jHWP417LCmzDKnmzZuDeo,19080
14
+ hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=Ln49jcpOQ4qzumv-SkWSBCqNgSP1dGQloKSLs7psP90,20991
15
15
  hafnia/dataset/dataset_recipe/recipe_transforms.py,sha256=j3Oiytt3LI2rCaJid7Y44oT9MXvlZVqvZanngMebIWg,3088
16
16
  hafnia/dataset/dataset_recipe/recipe_types.py,sha256=AcrG6gpRt3Igl-CCJ60uyh-WkfI1NCnQ55M8yClSI9Q,5328
17
17
  hafnia/dataset/format_conversions/format_coco.py,sha256=7GjeF016ZBaKxu-VYiqXxuPw8HuuODV1cxc2TbDDZBw,19628
18
18
  hafnia/dataset/format_conversions/format_helpers.py,sha256=-lNgn_mrpVM_Xwb3jHH0BlBEPCMKjLqTeYf4PbssbuQ,1144
19
19
  hafnia/dataset/format_conversions/format_image_classification_folder.py,sha256=ALVsQfSvBfAkpmUDijznqqd2JBh0Qtnvzq7igxMjMb8,7170
20
20
  hafnia/dataset/format_conversions/format_yolo.py,sha256=zvCHo2L_0mPJScMbDtwvZUts9UX2ERKhhYbY31Q6tQA,9912
21
- hafnia/dataset/format_conversions/torchvision_datasets.py,sha256=EmdTKNxrPT-qE8u7ZzNi9TxdwEBdXRphVliKTWgN0B4,12007
21
+ hafnia/dataset/format_conversions/torchvision_datasets.py,sha256=sC8DgAt10PEaCHFk_Lm-dIzr_0EF-2g24kG9EINYk7c,12096
22
+ hafnia/dataset/operations/dataset_s3_storage.py,sha256=xPC77Og47xTpI0JBFAR1pgb5u7l18byAA6p7IlpnpGE,8971
22
23
  hafnia/dataset/operations/dataset_stats.py,sha256=Ltf-V4_o_IB4UXw9WG9bsVoqeX90yGsjivK0CDggriw,11930
23
24
  hafnia/dataset/operations/dataset_transformations.py,sha256=qUNno0rAT1A452uzlR-k1WbatyY9VuMp1QJjkMg9GzE,19495
24
- hafnia/dataset/operations/table_transformations.py,sha256=l90CLGNZZVhedcEH5r4T3f7OyCprj-2vNKeYXsmWku0,14370
25
+ hafnia/dataset/operations/table_transformations.py,sha256=mdjUE1lSQ7QyONjQapSHDg1MkYuKaflcoVUq1Y6Lkqc,13606
25
26
  hafnia/dataset/primitives/__init__.py,sha256=xFLJ3R7gpbuQnNJuFhuu836L3nicwoaY5aHkqk7Bbr8,927
26
27
  hafnia/dataset/primitives/bbox.py,sha256=QJJBebltOd9J3idisp3QdX0gCgz6P5xlIlGbth19fG0,6669
27
28
  hafnia/dataset/primitives/bitmask.py,sha256=Q7RiNYvMDlcFPkXAWXDJkCIERjnUTCrHu6VeEPX1jEA,7212
@@ -36,9 +37,10 @@ hafnia/experiment/hafnia_logger.py,sha256=BHIOLAds_3JxT0cev_ikUH0XQVIxBJTkcBSx2Q
36
37
  hafnia/platform/__init__.py,sha256=L_Q7CNpsJ0HMNPy_rLlLK5RhmuCU7IF4BchxKv6amYc,782
37
38
  hafnia/platform/builder.py,sha256=kUEuj5-qtL1uk5v2tUvOCREn5yV-G4Fr6F31haIAb5E,5808
38
39
  hafnia/platform/dataset_recipe.py,sha256=ybfSSHVPG0eFUbzg_1McezPSOtMoDZEg7l6rFYndtb4,3857
39
- hafnia/platform/datasets.py,sha256=RX4XqJ4GRYw4CvrF8-87KWPVBJbg97w8JAUqkWR5F_g,9022
40
- hafnia/platform/download.py,sha256=A6McEvRw5KmEAn3kx3nNnjxQm1Z8ZSAhn_NFgrM66_8,5020
40
+ hafnia/platform/datasets.py,sha256=nXHg3I14p3tJeDX2woPH9NMiOxn_54zlIOPJXvXFI_w,9448
41
+ hafnia/platform/download.py,sha256=e73Pm0afwRPTHxBvRy0gUZSFfDuePHPnfasyhaZ-KGQ,5019
41
42
  hafnia/platform/experiment.py,sha256=SrEH0nuwwBXf1Iu4diB1BEPqL-TxW3aQkZWBbM1-tY0,1846
43
+ hafnia/platform/s5cmd_utils.py,sha256=hHsGPJ1S9_hFIVfCO-efvTF4qbLYreK1nl3VC5caU1w,9491
42
44
  hafnia/platform/trainer_package.py,sha256=w6JC7o-279ujcwtNTbUaQ9AnPcYRPPbD8EACa6XyUHA,2206
43
45
  hafnia/visualizations/colors.py,sha256=003eAJVnBal4abaYIIpsrT7erIOIjTUHHYVJ1Tj1CDc,5226
44
46
  hafnia/visualizations/image_visualizations.py,sha256=rB7c-KK-qq0BsSdkaFxCAHOOCTXTUQx0VMEhib7ig0k,7509
@@ -46,15 +48,15 @@ hafnia_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
48
  hafnia_cli/__main__.py,sha256=CqD_7RfbfwB6MED3WZ8WxclrFxWcRMtZ5A1Snnst3GM,1761
47
49
  hafnia_cli/config.py,sha256=X0dJBYH-7mNAFkHgeZvDbawlQqoyCwoY4C-QhlyYCA0,7695
48
50
  hafnia_cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
49
- hafnia_cli/dataset_cmds.py,sha256=fzw8LVn1mR319qorxK7HJ6Bs9lM9GdpMBkA6tAqssIg,1432
51
+ hafnia_cli/dataset_cmds.py,sha256=JfSj7Cei1T2oYUXP1bpz63uQopgL3R_dMMYnPGGcuU8,2072
50
52
  hafnia_cli/dataset_recipe_cmds.py,sha256=OYSmpKL0Wxo1ZSxIGfH6w7pEWoI7CjUTmfIELJSZjGQ,2894
51
53
  hafnia_cli/experiment_cmds.py,sha256=_KxsMhbjlkIno1PIMXJ0Omw_PSJi8qi9hmtCUqwcj1M,7970
52
54
  hafnia_cli/keychain.py,sha256=bNyjjULVQu7kV338wUC65UvbCwmSGOmEjKWPLIQjT0k,2555
53
- hafnia_cli/profile_cmds.py,sha256=1SJGMQM9tBwvS3prSehw6CgHW9cmrO2EZ7CAsH4f7qU,3477
54
- hafnia_cli/runc_cmds.py,sha256=38SGajsizpAydawCWL6gwza9NtLugtHfCdnldllwWJI,5016
55
+ hafnia_cli/profile_cmds.py,sha256=yTyOsPsUssLCzFIxURkxbKrFEhYIVDlUC0G2s5Uks-U,3476
56
+ hafnia_cli/runc_cmds.py,sha256=7P5TjF6KA9K4OKPG1qC_0gteXfLJbXlA858WWrosoGQ,5098
55
57
  hafnia_cli/trainer_package_cmds.py,sha256=hUBc6gCMV28fcAA0xQdXKL1z-a3aL9lMWcVqjvHO1Uo,2326
56
- hafnia-0.4.3.dist-info/METADATA,sha256=VO_uuOnjeKRtV9yuyUKtILlZV6Oi8TqO1BwhcIXk5xg,19273
57
- hafnia-0.4.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
- hafnia-0.4.3.dist-info/entry_points.txt,sha256=j2jsj1pqajLAiSOnF7sq66A3d1SVeHPKVTVyIFzipSA,52
59
- hafnia-0.4.3.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
60
- hafnia-0.4.3.dist-info/RECORD,,
58
+ hafnia-0.5.1.dist-info/METADATA,sha256=QkN31qwV-oFfSrp_s2pXEc5GFRhY0sn5dBVo8r-qOAs,19272
59
+ hafnia-0.5.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
+ hafnia-0.5.1.dist-info/entry_points.txt,sha256=j2jsj1pqajLAiSOnF7sq66A3d1SVeHPKVTVyIFzipSA,52
61
+ hafnia-0.5.1.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
62
+ hafnia-0.5.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -3,8 +3,8 @@ from typing import Optional
3
3
 
4
4
  import click
5
5
 
6
+ import hafnia.dataset.hafnia_dataset
6
7
  from hafnia import utils
7
- from hafnia_cli import consts
8
8
  from hafnia_cli.config import Config
9
9
 
10
10
 
@@ -26,6 +26,13 @@ def cmd_list_datasets(cfg: Config) -> None:
26
26
 
27
27
  @dataset.command("download")
28
28
  @click.argument("dataset_name")
29
+ @click.option(
30
+ "--version",
31
+ "-v",
32
+ default="latest",
33
+ required=False,
34
+ help="Dataset version to download e.g. '0.0.1' or '1.0.1'. Defaults to the latest version.",
35
+ )
29
36
  @click.option(
30
37
  "--destination",
31
38
  "-d",
@@ -35,18 +42,35 @@ def cmd_list_datasets(cfg: Config) -> None:
35
42
  )
36
43
  @click.option("--force", "-f", is_flag=True, default=False, help="Flag to enable force redownload")
37
44
  @click.pass_obj
38
- def cmd_dataset_download(cfg: Config, dataset_name: str, destination: Optional[click.Path], force: bool) -> Path:
45
+ def cmd_dataset_download(
46
+ cfg: Config, dataset_name: str, version: Optional[str], destination: Optional[click.Path], force: bool
47
+ ) -> Path:
39
48
  """Download dataset from Hafnia platform"""
40
49
 
50
+ path_dataset = hafnia.dataset.hafnia_dataset.download_or_get_dataset_path(
51
+ dataset_name=dataset_name,
52
+ version=version,
53
+ cfg=cfg,
54
+ path_datasets_folder=destination,
55
+ force_redownload=force,
56
+ )
57
+ return path_dataset
58
+
59
+
60
+ @dataset.command("delete")
61
+ @click.argument("dataset_name")
62
+ @click.option(
63
+ "--interactive/--no-interactive",
64
+ default=True,
65
+ help="Whether to ask for confirmation before deleting the dataset.",
66
+ )
67
+ @click.pass_obj
68
+ def cmd_dataset_delete(cfg: Config, dataset_name: str, interactive: bool) -> None:
69
+ """Delete dataset from Hafnia platform"""
41
70
  from hafnia.platform import datasets
42
71
 
43
- try:
44
- path_dataset = datasets.download_or_get_dataset_path(
45
- dataset_name=dataset_name,
46
- cfg=cfg,
47
- path_datasets_folder=destination,
48
- force_redownload=force,
49
- )
50
- except Exception:
51
- raise click.ClickException(consts.ERROR_GET_RESOURCE)
52
- return path_dataset
72
+ datasets.delete_dataset_completely_by_name(
73
+ dataset_name=dataset_name,
74
+ interactive=interactive,
75
+ cfg=cfg,
76
+ )
@@ -94,7 +94,6 @@ def cmd_profile_active(cfg: Config) -> None:
94
94
  def profile_show(cfg: Config) -> None:
95
95
  masked_key = f"{cfg.api_key[:11]}...{cfg.api_key[-4:]}" if len(cfg.api_key) > 20 else "****"
96
96
  console = Console()
97
-
98
97
  table = Table(title=f"{consts.PROFILE_TABLE_HEADER} {cfg.active_profile}", show_header=False)
99
98
  table.add_column("Property", style="cyan")
100
99
  table.add_column("Value")
hafnia_cli/runc_cmds.py CHANGED
@@ -38,7 +38,7 @@ def runc():
38
38
  @click.pass_obj
39
39
  def launch_local(cfg: Config, exec_cmd: str, dataset: str, image_name: str) -> None:
40
40
  """Launch a job within the image."""
41
- from hafnia.platform.datasets import download_or_get_dataset_path
41
+ from hafnia.dataset.hafnia_dataset import download_or_get_dataset_path
42
42
 
43
43
  is_local_dataset = "/" in dataset
44
44
  if is_local_dataset:
@@ -48,7 +48,12 @@ def launch_local(cfg: Config, exec_cmd: str, dataset: str, image_name: str) -> N
48
48
  raise click.ClickException(f"Dataset path does not exist: {path_dataset}")
49
49
  else:
50
50
  click.echo(f"Using Hafnia dataset: {dataset}")
51
- path_dataset = download_or_get_dataset_path(dataset_name=dataset, cfg=cfg, force_redownload=False)
51
+ path_dataset = download_or_get_dataset_path(
52
+ dataset_name=dataset,
53
+ version="latest",
54
+ cfg=cfg,
55
+ force_redownload=False,
56
+ )
52
57
 
53
58
  if image_name is None:
54
59
  # Load image name from state.json