Skip to content

Commit

Permalink
Merge pull request #442 from materialsproject/drop-__all__
Browse files Browse the repository at this point in the history
Remove `__all__` from all modules
  • Loading branch information
janosh authored Oct 3, 2023
2 parents 5b3508e + 604ef30 commit 8560427
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 42 deletions.
1 change: 0 additions & 1 deletion src/jobflow/core/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from jobflow import Job

__all__ = ["JobOrder", "Flow", "get_flow"]

logger = logging.getLogger(__name__)

Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

logger = logging.getLogger(__name__)

__all__ = ["job", "Job", "Response", "JobConfig", "store_inputs"]


@dataclass
class JobConfig(MSONable):
Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/core/maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

import jobflow

__all__ = ["Maker"]


@dataclass
class Maker(MSONable):
Expand Down
11 changes: 2 additions & 9 deletions src/jobflow/core/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
if typing.TYPE_CHECKING:
import jobflow

__all__ = [
"OnMissing",
"OutputReference",
"resolve_references",
"find_and_resolve_references",
"find_and_get_references",
]


class OnMissing(ValueEnum):
"""
Expand Down Expand Up @@ -165,7 +157,8 @@ def resolve(
if on_missing == OnMissing.ERROR and index not in cache[self.uuid]:
istr = f" ({index})" if index is not None else ""
raise ValueError(
f"Could not resolve reference - {self.uuid}{istr} not in store or cache"
f"Could not resolve reference - {self.uuid}{istr} not in store or "
f"{index=}, {cache=}"
)
elif on_missing == OnMissing.NONE and index not in cache[self.uuid]:
return None
Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import jobflow

__all__ = ["CURRENT_JOB"]


@singleton
class State:
Expand Down
1 change: 0 additions & 1 deletion src/jobflow/core/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
save_type = Optional[Dict[str, obj_type]]
load_type = Union[bool, Dict[str, Union[bool, obj_type]]]

__all__ = ["JobStore"]

T = typing.TypeVar("T", bound="JobStore")

Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/managers/fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

import jobflow

__all__ = ["flow_to_workflow", "job_to_firework", "JobFiretask"]


def flow_to_workflow(
flow: jobflow.Flow | jobflow.Job | list[jobflow.Job],
Expand Down
1 change: 0 additions & 1 deletion src/jobflow/managers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import jobflow

__all__ = ["run_locally"]

logger = logging.getLogger(__name__)

Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

DEFAULT_CONFIG_FILE_PATH = Path("~/.jobflow.yaml").expanduser().as_posix()

__all__ = ["JobflowSettings"]


def _default_additional_store():
"""Create a default MemoryStore and connect it.
Expand Down
3 changes: 0 additions & 3 deletions src/jobflow/utils/dict_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from typing import Any


__all__ = ["DictMods", "apply_mod"]


class DictMods:
"""
Class to define mongo-like modifications on a dict.
Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/utils/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from enum import Enum

__all__ = ["ValueEnum"]


class ValueEnum(Enum):
"""Enum that serializes to string as the value and can be compared against a str."""
Expand Down
7 changes: 0 additions & 7 deletions src/jobflow/utils/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@

from monty.json import MSONable

__all__ = [
"find_key",
"find_key_value",
"update_in_dictionary",
"contains_flow_or_job",
]


def find_key(
d: dict[Hashable, Any] | list[Any],
Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/utils/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import jobflow

__all__ = ["itergraph", "draw_graph", "to_pydot", "to_mermaid"]


def itergraph(graph: nx.DiGraph):
"""
Expand Down
2 changes: 0 additions & 2 deletions src/jobflow/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import logging

__all__ = ["initialize_logger"]


def initialize_logger(level: int = logging.INFO) -> logging.Logger:
"""Initialize the default logger.
Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@ def test_data_update(memory_data_jobstore):
assert results["data"] == [1, 2, 3, 4]

results = memory_data_jobstore.query_one(c, load={})
assert type(results["data"]) == dict
assert isinstance(results["data"], dict)
assert "@class" in results["data"]
assert "@module" in results["data"]
assert "blob_uuid" in results["data"]

results = memory_data_jobstore.query_one(c, load={"data": False})
assert type(results["data"]) == dict
assert isinstance(results["data"], dict)
assert "@class" in results["data"]
assert "@module" in results["data"]
assert "blob_uuid" in results["data"]

results = memory_data_jobstore.query_one(c, load=False)
assert type(results["data"]) == dict
assert isinstance(results["data"], dict)
assert "@class" in results["data"]
assert "@module" in results["data"]
assert "blob_uuid" in results["data"]

results = memory_data_jobstore.query_one(c, load=None)
assert type(results["data"]) == dict
assert isinstance(results["data"], dict)
assert "@class" in results["data"]
assert "@module" in results["data"]
assert "blob_uuid" in results["data"]
Expand Down

0 comments on commit 8560427

Please sign in to comment.