Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent a385070 commit ea5322b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/py21cmemu/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ def __str__(self) -> str:
"""Get the string representation of the config file."""
return str(self.config)

def keys(self) -> Generator[str, None, None]:
def keys(self) -> Generator[str]:
"""Yield the keys in the config file."""
yield from self.config.keys()

def values(self) -> Generator[Any, None, None]:
def values(self) -> Generator[Any]:
"""Yield the values in the config file."""
yield from self.config.values()

def items(self) -> Generator[tuple[str, Any], None, None]:
def items(self) -> Generator[tuple[str, Any]]:
"""Yield the keys and values of the main data products, like a dict."""
yield from self.config.items()

Expand All @@ -98,7 +98,7 @@ def update(self, **kw) -> None:
self.config_file.write_text(toml.dumps(self.config))

@contextmanager
def use(self, **kw) -> Generator[None, None, None]:
def use(self, **kw) -> Generator[None]:
"""Use configuration values temporarily."""
old = {k: self[k] for k in kw}
self.update(**kw)
Expand Down
4 changes: 2 additions & 2 deletions src/py21cmemu/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
class EmulatorOutput:
"""A simple class that makes it easier to access the corrected emulator output."""

def keys(self) -> Generator[str, None, None]:
def keys(self) -> Generator[str]:
"""Yield the keys of the main data products."""
for k in dc.fields(self):
yield k.name

def items(self) -> Generator[tuple[str, np.ndarray], None, None]:
def items(self) -> Generator[tuple[str, np.ndarray]]:
"""Yield the keys and values of the main data products, like a dict."""
for k in self.keys():
yield k, getattr(self, k)
Expand Down

0 comments on commit ea5322b

Please sign in to comment.