hafnia 0.4.1__py3-none-any.whl → 0.4.2__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.
@@ -98,8 +98,8 @@ class DatasetRecipe(Serializable):
98
98
  @staticmethod
99
99
  def from_recipe_id(recipe_id: str) -> "DatasetRecipe":
100
100
  """Loads a dataset recipe by id from the hafnia platform."""
101
- from cli.config import Config
102
101
  from hafnia.platform.dataset_recipe import get_dataset_recipe_by_id
102
+ from hafnia_cli.config import Config
103
103
 
104
104
  cfg = Config()
105
105
  endpoint_dataset = cfg.get_platform_endpoint("dataset_recipes")
@@ -114,8 +114,8 @@ class DatasetRecipe(Serializable):
114
114
  @staticmethod
115
115
  def from_recipe_name(name: str) -> "DatasetRecipe":
116
116
  """Loads a dataset recipe by name from the hafnia platform"""
117
- from cli.config import Config
118
117
  from hafnia.platform.dataset_recipe import get_dataset_recipe_by_name
118
+ from hafnia_cli.config import Config
119
119
 
120
120
  cfg = Config()
121
121
  endpoint_dataset = cfg.get_platform_endpoint("dataset_recipes")
@@ -239,8 +239,8 @@ class DatasetRecipe(Serializable):
239
239
 
240
240
  def as_platform_recipe(self, recipe_name: Optional[str], overwrite: bool = False) -> Dict:
241
241
  """Uploads dataset recipe to the hafnia platform."""
242
- from cli.config import Config
243
242
  from hafnia.platform.dataset_recipe import get_or_create_dataset_recipe
243
+ from hafnia_cli.config import Config
244
244
 
245
245
  recipe = self.as_dict()
246
246
  cfg = Config()
@@ -11,7 +11,6 @@ import polars as pl
11
11
  from PIL import Image
12
12
  from pydantic import BaseModel, ConfigDict, field_validator
13
13
 
14
- from cli.config import Config
15
14
  from hafnia.dataset import primitives
16
15
  from hafnia.dataset.dataset_names import (
17
16
  DatasetVariant,
@@ -33,6 +32,7 @@ from hafnia.dataset.primitives.primitive import Primitive
33
32
  from hafnia.http import post
34
33
  from hafnia.log import user_logger
35
34
  from hafnia.platform.datasets import get_dataset_id
35
+ from hafnia_cli.config import Config
36
36
 
37
37
 
38
38
  def generate_bucket_name(dataset_name: str, deployment_stage: DeploymentStage) -> str:
@@ -11,7 +11,6 @@ import rich
11
11
  from rich import print as rprint
12
12
  from rich.progress import track
13
13
 
14
- from cli.config import Config
15
14
  from hafnia import http, utils
16
15
  from hafnia.dataset.dataset_names import DATASET_FILENAMES_REQUIRED
17
16
  from hafnia.dataset.dataset_recipe.dataset_recipe import (
@@ -23,6 +22,7 @@ from hafnia.http import fetch
23
22
  from hafnia.log import sys_logger, user_logger
24
23
  from hafnia.platform.download import get_resource_credentials
25
24
  from hafnia.utils import timed
25
+ from hafnia_cli.config import Config
26
26
 
27
27
 
28
28
  @timed("Fetching dataset list.")
hafnia/utils.py CHANGED
@@ -207,7 +207,7 @@ def is_hafnia_configured() -> bool:
207
207
  """
208
208
  Check if Hafnia is configured by verifying if the API key is set.
209
209
  """
210
- from cli.config import Config
210
+ from hafnia_cli.config import Config
211
211
 
212
212
  return Config().is_configured()
213
213
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hafnia
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Python SDK for communication with Hafnia platform.
5
5
  Author-email: Milestone Systems <hafniaplatform@milestone.dk>
6
6
  License-File: LICENSE
@@ -1,27 +1,16 @@
1
- cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cli/__main__.py,sha256=1IOe1Ewd3QMeuzUMfoWv663_jQpd7_pTn_R1sDdEmbI,1747
3
- cli/config.py,sha256=xCLdgqBqFN3EInzJ1AO5Nj1e35jOjcc_jaukaodrrMc,7681
4
- cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
5
- cli/dataset_cmds.py,sha256=KOPYdAJ1SyzTMlEi_J-70vSGIJ5acHPGIPOCKVIdlQ4,1418
6
- cli/dataset_recipe_cmds.py,sha256=O1Pd-VvFFsmZ-nE1Mh6sCC9x45ztCJEpPCZK93qz_HQ,2887
7
- cli/experiment_cmds.py,sha256=vc7J9JJog4EvRdgkpoMvr0kceb0QF_Rk7mn6H2KNvFE,7963
8
- cli/keychain.py,sha256=bNyjjULVQu7kV338wUC65UvbCwmSGOmEjKWPLIQjT0k,2555
9
- cli/profile_cmds.py,sha256=3OwpomV6Wb21ZG43xrwhvoB5S4IN1IqmVCxs-MItAho,3463
10
- cli/runc_cmds.py,sha256=qV-LOwbFlbegH8XSELOo4h_2ajFAzdB5LtuVKKoRq8Y,5009
11
- cli/trainer_package_cmds.py,sha256=nL7yTtR41BKzo1DWZdBdpRXGPZZIbmBe0byHAi6_n2c,2312
12
1
  hafnia/__init__.py,sha256=0qpjWfVbcfKzLSnfUW6RdclSGkesMQRFS-n_aTJJoSE,179
13
2
  hafnia/http.py,sha256=bjXbV_3uKbBdudqMdYtnsMttUAsNRMsetYZ4F2xXlEs,3635
14
3
  hafnia/log.py,sha256=sWF8tz78yBtwZ9ddzm19L1MBSBJ3L4G704IGeT1_OEU,784
15
4
  hafnia/torch_helpers.py,sha256=8jbXm6yk8joXFyuwxopaIAjvjMbEZbFT5qSswQSbpdg,11665
16
- hafnia/utils.py,sha256=ieNNL8IK3IqDsRf7NJnF_NU3eMLi8d3tSQzOgW5sVOw,7319
5
+ hafnia/utils.py,sha256=k9IMWZ_5tDB5fdo4vcHJDxAIYgiMLvHqFepBC8H5n4k,7326
17
6
  hafnia/data/__init__.py,sha256=o9QjiGbEcNa6r-qDmwwmxPXf-1UitNl5-WxFNcujqsg,111
18
7
  hafnia/data/factory.py,sha256=kHkvOtBUbwaShZBGf1kZzocDJBn_1dHHLrQxnUpJmfY,778
19
8
  hafnia/dataset/dataset_helpers.py,sha256=0GbS6PfaiYBulDKRCbd0miN5LHaUIp-XzGt_wZay8xs,5044
20
9
  hafnia/dataset/dataset_names.py,sha256=jxK1XWLu8jzYRkIw-xw0x2Vf1D3HPdphm7yGHtYx-Os,5883
21
- hafnia/dataset/dataset_upload_helper.py,sha256=vTO2-gvo7cYsK0967N8zGoFKDDXJcrfRim_532wUiqc,30307
10
+ hafnia/dataset/dataset_upload_helper.py,sha256=OvS3jdFigQTOE4SQK2onY4QCPnisTlR2misndv46KdU,30314
22
11
  hafnia/dataset/hafnia_dataset.py,sha256=O4ZUA6Y7EidlYn6R-3kILYGmqh3yTTiaCTZkPwolaL0,49560
23
12
  hafnia/dataset/license_types.py,sha256=xpanTfui1pGG76mGQ9r6EywcUe1scI_zullEpmCO4GI,2190
24
- hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=mwNL7VMhbEFHC2p6L_OO7os7bVVb05YFKZxvzQ_BySk,19059
13
+ hafnia/dataset/dataset_recipe/dataset_recipe.py,sha256=CkU61k_qaPSu_4Yo-NArr7jHWP417LCmzDKnmzZuDeo,19080
25
14
  hafnia/dataset/dataset_recipe/recipe_transforms.py,sha256=j3Oiytt3LI2rCaJid7Y44oT9MXvlZVqvZanngMebIWg,3088
26
15
  hafnia/dataset/dataset_recipe/recipe_types.py,sha256=AcrG6gpRt3Igl-CCJ60uyh-WkfI1NCnQ55M8yClSI9Q,5328
27
16
  hafnia/dataset/format_conversions/format_image_classification_folder.py,sha256=V4W0gmMrZTEG81rmlNIa2oYUtQuci4LU3AiUHJg63iw,4370
@@ -44,14 +33,25 @@ hafnia/experiment/hafnia_logger.py,sha256=Qia8orPu7PZk12geB97alJaq6AjxYedDmKri_t
44
33
  hafnia/platform/__init__.py,sha256=L_Q7CNpsJ0HMNPy_rLlLK5RhmuCU7IF4BchxKv6amYc,782
45
34
  hafnia/platform/builder.py,sha256=kUEuj5-qtL1uk5v2tUvOCREn5yV-G4Fr6F31haIAb5E,5808
46
35
  hafnia/platform/dataset_recipe.py,sha256=ybfSSHVPG0eFUbzg_1McezPSOtMoDZEg7l6rFYndtb4,3857
47
- hafnia/platform/datasets.py,sha256=APtG0evcO7gxFbk8N7sWJPxttYLQTJ4ZkZHLuY-rRN0,9000
36
+ hafnia/platform/datasets.py,sha256=DHqpeFWZPp8TGetZWSmNDd1ooUr5650tf-X_TDouXEA,9007
48
37
  hafnia/platform/download.py,sha256=A6McEvRw5KmEAn3kx3nNnjxQm1Z8ZSAhn_NFgrM66_8,5020
49
38
  hafnia/platform/experiment.py,sha256=SrEH0nuwwBXf1Iu4diB1BEPqL-TxW3aQkZWBbM1-tY0,1846
50
39
  hafnia/platform/trainer_package.py,sha256=w6JC7o-279ujcwtNTbUaQ9AnPcYRPPbD8EACa6XyUHA,2206
51
40
  hafnia/visualizations/colors.py,sha256=003eAJVnBal4abaYIIpsrT7erIOIjTUHHYVJ1Tj1CDc,5226
52
41
  hafnia/visualizations/image_visualizations.py,sha256=0xsDQqeNZ-9Oat4u5NZwXLXoh4yZ5DisczkZNHTRwkk,7457
53
- hafnia-0.4.1.dist-info/METADATA,sha256=ynd2TZrdVHzkDMmOZ3xF2ozYoovFwKQMCK60ydKbdYQ,19233
54
- hafnia-0.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
55
- hafnia-0.4.1.dist-info/entry_points.txt,sha256=FCJVIQ8GP2VE9I3eeGVF5eLxVDNW_01pOJCpG_CGnMM,45
56
- hafnia-0.4.1.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
57
- hafnia-0.4.1.dist-info/RECORD,,
42
+ hafnia_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ hafnia_cli/__main__.py,sha256=CqD_7RfbfwB6MED3WZ8WxclrFxWcRMtZ5A1Snnst3GM,1761
44
+ hafnia_cli/config.py,sha256=X0dJBYH-7mNAFkHgeZvDbawlQqoyCwoY4C-QhlyYCA0,7695
45
+ hafnia_cli/consts.py,sha256=uCpYX44NCu_Zvte0QwChunxOo-qqhcaJRSYDAIsoJ8A,972
46
+ hafnia_cli/dataset_cmds.py,sha256=fzw8LVn1mR319qorxK7HJ6Bs9lM9GdpMBkA6tAqssIg,1432
47
+ hafnia_cli/dataset_recipe_cmds.py,sha256=OYSmpKL0Wxo1ZSxIGfH6w7pEWoI7CjUTmfIELJSZjGQ,2894
48
+ hafnia_cli/experiment_cmds.py,sha256=_KxsMhbjlkIno1PIMXJ0Omw_PSJi8qi9hmtCUqwcj1M,7970
49
+ hafnia_cli/keychain.py,sha256=bNyjjULVQu7kV338wUC65UvbCwmSGOmEjKWPLIQjT0k,2555
50
+ hafnia_cli/profile_cmds.py,sha256=1SJGMQM9tBwvS3prSehw6CgHW9cmrO2EZ7CAsH4f7qU,3477
51
+ hafnia_cli/runc_cmds.py,sha256=38SGajsizpAydawCWL6gwza9NtLugtHfCdnldllwWJI,5016
52
+ hafnia_cli/trainer_package_cmds.py,sha256=hUBc6gCMV28fcAA0xQdXKL1z-a3aL9lMWcVqjvHO1Uo,2326
53
+ hafnia-0.4.2.dist-info/METADATA,sha256=HsdqvFWvRsRkW14QAIodLlGR_sPdd9UXUgKDSWhrVGk,19233
54
+ hafnia-0.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
55
+ hafnia-0.4.2.dist-info/entry_points.txt,sha256=j2jsj1pqajLAiSOnF7sq66A3d1SVeHPKVTVyIFzipSA,52
56
+ hafnia-0.4.2.dist-info/licenses/LICENSE,sha256=wLZw1B7_mod_CO1H8LXqQgfqlWD6QceJR8--LJYRZGE,1078
57
+ hafnia-0.4.2.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ hafnia = hafnia_cli.__main__:main
@@ -2,7 +2,7 @@
2
2
  import click
3
3
 
4
4
  import hafnia
5
- from cli import (
5
+ from hafnia_cli import (
6
6
  consts,
7
7
  dataset_cmds,
8
8
  dataset_recipe_cmds,
@@ -11,7 +11,7 @@ from cli import (
11
11
  runc_cmds,
12
12
  trainer_package_cmds,
13
13
  )
14
- from cli.config import Config, ConfigSchema
14
+ from hafnia_cli.config import Config, ConfigSchema
15
15
 
16
16
 
17
17
  @click.group()
@@ -5,8 +5,8 @@ from typing import Dict, List, Optional
5
5
 
6
6
  from pydantic import BaseModel, field_validator
7
7
 
8
- import cli.consts as consts
9
- import cli.keychain as keychain
8
+ import hafnia_cli.consts as consts
9
+ import hafnia_cli.keychain as keychain
10
10
  from hafnia.log import sys_logger, user_logger
11
11
 
12
12
  PLATFORM_API_MAPPING = {
@@ -3,9 +3,9 @@ from typing import Optional
3
3
 
4
4
  import click
5
5
 
6
- from cli import consts
7
- from cli.config import Config
8
6
  from hafnia import utils
7
+ from hafnia_cli import consts
8
+ from hafnia_cli.config import Config
9
9
 
10
10
 
11
11
  @click.group()
@@ -4,7 +4,7 @@ from typing import Dict, Optional
4
4
  import click
5
5
  from rich import print as rprint
6
6
 
7
- from cli.config import Config
7
+ from hafnia_cli.config import Config
8
8
 
9
9
 
10
10
  @click.group(name="dataset-recipe")
@@ -3,7 +3,6 @@ from typing import Dict, Optional
3
3
 
4
4
  import click
5
5
 
6
- from cli.config import Config
7
6
  from hafnia import utils
8
7
  from hafnia.platform.dataset_recipe import (
9
8
  get_dataset_recipe_by_id,
@@ -11,6 +10,7 @@ from hafnia.platform.dataset_recipe import (
11
10
  get_or_create_dataset_recipe_by_dataset_name,
12
11
  )
13
12
  from hafnia.platform.trainer_package import create_trainer_package
13
+ from hafnia_cli.config import Config
14
14
 
15
15
 
16
16
  @click.group(name="experiment")
@@ -2,8 +2,8 @@ import click
2
2
  from rich.console import Console
3
3
  from rich.table import Table
4
4
 
5
- import cli.consts as consts
6
- from cli.config import Config, ConfigSchema
5
+ import hafnia_cli.consts as consts
6
+ from hafnia_cli.config import Config, ConfigSchema
7
7
 
8
8
 
9
9
  @click.group()
@@ -7,8 +7,8 @@ from typing import Optional
7
7
 
8
8
  import click
9
9
 
10
- from cli.config import Config
11
10
  from hafnia.log import sys_logger, user_logger
11
+ from hafnia_cli.config import Config
12
12
 
13
13
 
14
14
  @click.group(name="runc")
@@ -3,8 +3,8 @@ from typing import Optional
3
3
 
4
4
  import click
5
5
 
6
- import cli.consts as consts
7
- from cli.config import Config
6
+ import hafnia_cli.consts as consts
7
+ from hafnia_cli.config import Config
8
8
 
9
9
 
10
10
  @click.group(name="trainer")
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- hafnia = cli.__main__:main
File without changes
File without changes
File without changes
File without changes