jobflow 0.1.10__tar.gz → 0.1.11__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 (33) hide show
  1. {jobflow-0.1.10/src/jobflow.egg-info → jobflow-0.1.11}/PKG-INFO +3 -3
  2. {jobflow-0.1.10 → jobflow-0.1.11}/README.md +1 -1
  3. {jobflow-0.1.10 → jobflow-0.1.11}/pyproject.toml +3 -22
  4. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/flow.py +1 -1
  5. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/job.py +18 -16
  6. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/reference.py +6 -7
  7. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/store.py +2 -2
  8. {jobflow-0.1.10 → jobflow-0.1.11/src/jobflow.egg-info}/PKG-INFO +3 -3
  9. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow.egg-info/requires.txt +2 -2
  10. {jobflow-0.1.10 → jobflow-0.1.11}/LICENSE +0 -0
  11. {jobflow-0.1.10 → jobflow-0.1.11}/setup.cfg +0 -0
  12. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/__init__.py +0 -0
  13. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/_version.py +0 -0
  14. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/__init__.py +0 -0
  15. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/maker.py +0 -0
  16. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/core/state.py +0 -0
  17. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/managers/__init__.py +0 -0
  18. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/managers/fireworks.py +0 -0
  19. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/managers/local.py +0 -0
  20. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/py.typed +0 -0
  21. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/settings.py +0 -0
  22. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/__init__.py +0 -0
  23. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/dict_mods.py +0 -0
  24. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/enum.py +0 -0
  25. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/find.py +0 -0
  26. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/graph.py +0 -0
  27. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/log.py +0 -0
  28. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow/utils/uuid.py +0 -0
  29. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow.egg-info/SOURCES.txt +0 -0
  30. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow.egg-info/dependency_links.txt +0 -0
  31. {jobflow-0.1.10 → jobflow-0.1.11}/src/jobflow.egg-info/top_level.txt +0 -0
  32. {jobflow-0.1.10 → jobflow-0.1.11}/tests/test_settings.py +0 -0
  33. {jobflow-0.1.10 → jobflow-0.1.11}/tests/test_version.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jobflow
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: jobflow is a library for writing computational workflows
5
5
  Author-email: Alex Ganose <alexganose@gmail.com>
6
6
  License: modified BSD
7
7
  Project-URL: homepage, https://materialsproject.github.io/jobflow/
8
- Project-URL: repository, https://github.com/hackingmaterials/jobflow
8
+ Project-URL: repository, https://github.com/materialsproject/jobflow
9
9
  Project-URL: documentation, https://materialsproject.github.io/jobflow/
10
10
  Project-URL: changelog, https://github.com/materialsproject/jobflow/blob/main/CHANGELOG.md
11
11
  Keywords: high-throughput,workflow
@@ -109,7 +109,7 @@ the jobs is determined automatically and can be visualised using the flow graph.
109
109
 
110
110
  ## Installation
111
111
 
112
- The jobflow is a Python 3.7+ library and can be installed using pip.
112
+ The jobflow is a Python 3.8+ library and can be installed using pip.
113
113
 
114
114
  ```bash
115
115
  pip install jobflow
@@ -76,7 +76,7 @@ the jobs is determined automatically and can be visualised using the flow graph.
76
76
 
77
77
  ## Installation
78
78
 
79
- The jobflow is a Python 3.7+ library and can be installed using pip.
79
+ The jobflow is a Python 3.8+ library and can be installed using pip.
80
80
 
81
81
  ```bash
82
82
  pip install jobflow
@@ -40,7 +40,7 @@ docs = [
40
40
  "furo==2022.12.7",
41
41
  "myst_parser==1.0.0",
42
42
  "ipython==8.11.0",
43
- "nbsphinx==0.8.12",
43
+ "nbsphinx==0.9.0",
44
44
  "autodoc_pydantic==1.8.0",
45
45
  ]
46
46
  dev = ["pre-commit>=2.12.1"]
@@ -52,7 +52,7 @@ strict = [
52
52
  "networkx==3.0",
53
53
  "pydash==6.0.2",
54
54
  "maggma==0.50.3",
55
- "pydantic==1.10.5",
55
+ "pydantic==1.10.6",
56
56
  "PyYAML==6.0",
57
57
  "FireWorks==2.0.3",
58
58
  "matplotlib==3.7.1",
@@ -62,7 +62,7 @@ strict = [
62
62
 
63
63
  [project.urls]
64
64
  homepage = "https://materialsproject.github.io/jobflow/"
65
- repository = "https://github.com/hackingmaterials/jobflow"
65
+ repository = "https://github.com/materialsproject/jobflow"
66
66
  documentation = "https://materialsproject.github.io/jobflow/"
67
67
  changelog = "https://github.com/materialsproject/jobflow/blob/main/CHANGELOG.md"
68
68
 
@@ -132,25 +132,6 @@ select = [
132
132
  "W", # pycodestyle
133
133
  "YTT", # flake8-2020
134
134
  ]
135
- ignore = [
136
- "B019", # functools.lru_cache on methods can lead to memory leaks
137
- "B023", # Function definition does not bind loop variable
138
- "B904", # Within an except clause, raise exceptions with ...
139
- "D100", # Missing docstring in public module
140
- "D104", # Missing docstring in public package
141
- "D105", # Missing docstring in magic method
142
- "D107", # Missing docstring in __init__
143
- "D200", # One-line docstring should fit on one line with quotes
144
- "D205", # 1 blank line required between summary line and description
145
- "D212", # Multi-line docstring summary should start at the first line
146
- "D415", # First line should end with a period, question mark, or exclamation point
147
- "E741", # tmp: we should fix all ambiguous variable names
148
- "PLR2004", # Magic number
149
- "PLW0120", # awaiting bug fix https://github.com/charliermarsh/ruff/issues/3019
150
- "C408", # Unnecessary dict call - rewrite as a literal
151
- "D416", # Section name should end with a colon
152
- "SIM105", # Use contextlib.suppress(socket.gaierror, socket.herror) instead of try-except-pass
153
- ]
154
135
  pydocstyle.convention = "numpy"
155
136
  isort.known-first-party = ["jobflow"]
156
137
 
@@ -140,7 +140,7 @@ class Flow(MSONable):
140
140
  self.uuid = uuid
141
141
  self.hosts = hosts or []
142
142
 
143
- self._jobs: tuple[Flow | Job, ...] = tuple()
143
+ self._jobs: tuple[Flow | Job, ...] = ()
144
144
  self.add_jobs(jobs)
145
145
  self.output = output
146
146
 
@@ -324,7 +324,7 @@ class Job(MSONable):
324
324
 
325
325
  from jobflow.utils.find import contains_flow_or_job
326
326
 
327
- function_args = tuple() if function_args is None else function_args
327
+ function_args = () if function_args is None else function_args
328
328
  function_kwargs = {} if function_kwargs is None else function_kwargs
329
329
  uuid = suuid() if uuid is None else uuid
330
330
  metadata = {} if metadata is None else metadata
@@ -585,12 +585,14 @@ class Job(MSONable):
585
585
  pass_manager_config(response.replace, passed_config)
586
586
 
587
587
  try:
588
- output = jsanitize(response.output, strict=True, enum_values=True)
589
- except AttributeError:
588
+ output = jsanitize(
589
+ response.output, strict=True, enum_values=True, allow_bson=True
590
+ )
591
+ except AttributeError as err:
590
592
  raise RuntimeError(
591
593
  "Job output contained an object that is not MSONable and therefore "
592
594
  "could not be serialized."
593
- )
595
+ ) from err
594
596
 
595
597
  save = {k: "output" if v is True else v for k, v in self._kwargs.items()}
596
598
  data = {
@@ -905,12 +907,12 @@ class Job(MSONable):
905
907
  from jobflow.utils.dict_mods import apply_mod
906
908
 
907
909
  if dynamic:
908
- dict_input = dict(
909
- update=update,
910
- name_filter=name_filter,
911
- function_filter=function_filter,
912
- dict_mod=dict_mod,
913
- )
910
+ dict_input = {
911
+ "update": update,
912
+ "name_filter": name_filter,
913
+ "function_filter": function_filter,
914
+ "dict_mod": dict_mod,
915
+ }
914
916
  self.metadata_updates.append(dict_input)
915
917
 
916
918
  # unwrap the functions in case the job is a decorated one
@@ -1014,12 +1016,12 @@ class Job(MSONable):
1014
1016
  only be set for the `test_job` and not for the generated Jobs.
1015
1017
  """
1016
1018
  if dynamic:
1017
- dict_input = dict(
1018
- config=config,
1019
- name_filter=name_filter,
1020
- function_filter=function_filter,
1021
- attributes=attributes,
1022
- )
1019
+ dict_input = {
1020
+ "config": config,
1021
+ "name_filter": name_filter,
1022
+ "function_filter": function_filter,
1023
+ "attributes": attributes,
1024
+ }
1023
1025
  self.config_updates.append(dict_input)
1024
1026
 
1025
1027
  # unwrap the functions in case the job is a decorated one
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import contextlib
5
6
  import typing
6
7
  from typing import Any, Sequence
7
8
 
@@ -93,7 +94,7 @@ class OutputReference(MSONable):
93
94
  def __init__(
94
95
  self,
95
96
  uuid: str,
96
- attributes: tuple[tuple[str, Any], ...] = tuple(),
97
+ attributes: tuple[tuple[str, Any], ...] = (),
97
98
  output_schema: type[BaseModel] | None = None,
98
99
  ):
99
100
  super().__init__()
@@ -157,12 +158,10 @@ class OutputReference(MSONable):
157
158
  index = None if result is None else result["index"]
158
159
 
159
160
  if index is not None and index not in cache[self.uuid]:
160
- try:
161
+ with contextlib.suppress(ValueError):
161
162
  cache[self.uuid][index] = store.get_output(
162
163
  self.uuid, which="last", load=True, on_missing=on_missing
163
164
  )
164
- except ValueError:
165
- pass
166
165
 
167
166
  if on_missing == OnMissing.ERROR and index not in cache[self.uuid]:
168
167
  istr = f" ({index})" if index is not None else ""
@@ -390,9 +389,9 @@ def find_and_get_references(arg: Any) -> tuple[OutputReference, ...]:
390
389
 
391
390
  elif isinstance(arg, (float, int, str, bool)):
392
391
  # argument is a primitive, we won't find a reference here
393
- return tuple()
392
+ return ()
394
393
 
395
- arg = jsanitize(arg, strict=True, enum_values=True)
394
+ arg = jsanitize(arg, strict=True, enum_values=True, allow_bson=True)
396
395
 
397
396
  # recursively find any reference classes
398
397
  locations = find_key_value(arg, "@class", "OutputReference")
@@ -449,7 +448,7 @@ def find_and_resolve_references(
449
448
  return arg
450
449
 
451
450
  # serialize the argument to a dictionary
452
- encoded_arg = jsanitize(arg, strict=True, enum_values=True)
451
+ encoded_arg = jsanitize(arg, strict=True, enum_values=True, allow_bson=True)
453
452
 
454
453
  # recursively find any reference classes
455
454
  locations = find_key_value(encoded_arg, "@class", "OutputReference")
@@ -210,7 +210,7 @@ class JobStore(Store):
210
210
  properties=["blob_uuid", "data"],
211
211
  )
212
212
  object_map = {o["blob_uuid"]: o["data"] for o in objects}
213
- inserts = {tuple(l): object_map[o] for o, l in object_info.items()}
213
+ inserts = {tuple(v): object_map[k] for k, v in object_info.items()}
214
214
  to_insert.update(inserts)
215
215
 
216
216
  update_in_dictionary(doc, to_insert)
@@ -737,7 +737,7 @@ def _filter_blobs(
737
737
  from collections import defaultdict
738
738
 
739
739
  def _group_blobs(infos, locs):
740
- grouped = defaultdict(lambda: (list(), list()))
740
+ grouped = defaultdict(lambda: ([], []))
741
741
  for info, loc in zip(infos, locs):
742
742
  grouped[info["store"]][0].append(info)
743
743
  grouped[info["store"]][1].append(loc)
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jobflow
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: jobflow is a library for writing computational workflows
5
5
  Author-email: Alex Ganose <alexganose@gmail.com>
6
6
  License: modified BSD
7
7
  Project-URL: homepage, https://materialsproject.github.io/jobflow/
8
- Project-URL: repository, https://github.com/hackingmaterials/jobflow
8
+ Project-URL: repository, https://github.com/materialsproject/jobflow
9
9
  Project-URL: documentation, https://materialsproject.github.io/jobflow/
10
10
  Project-URL: changelog, https://github.com/materialsproject/jobflow/blob/main/CHANGELOG.md
11
11
  Keywords: high-throughput,workflow
@@ -109,7 +109,7 @@ the jobs is determined automatically and can be visualised using the flow graph.
109
109
 
110
110
  ## Installation
111
111
 
112
- The jobflow is a Python 3.7+ library and can be installed using pip.
112
+ The jobflow is a Python 3.8+ library and can be installed using pip.
113
113
 
114
114
  ```bash
115
115
  pip install jobflow
@@ -13,7 +13,7 @@ sphinx==6.1.3
13
13
  furo==2022.12.7
14
14
  myst_parser==1.0.0
15
15
  ipython==8.11.0
16
- nbsphinx==0.8.12
16
+ nbsphinx==0.9.0
17
17
  autodoc_pydantic==1.8.0
18
18
 
19
19
  [fireworks]
@@ -24,7 +24,7 @@ monty==2022.9.9
24
24
  networkx==3.0
25
25
  pydash==6.0.2
26
26
  maggma==0.50.3
27
- pydantic==1.10.5
27
+ pydantic==1.10.6
28
28
  PyYAML==6.0
29
29
  FireWorks==2.0.3
30
30
  matplotlib==3.7.1
File without changes
File without changes
File without changes
File without changes