Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #220

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -46,7 +46,7 @@ repos:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand Down
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
Loading