Skip to content

Commit

Permalink
flake8: make the linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
r-pascua committed Jan 17, 2023
1 parent 9c8534c commit ac9fed1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hera_sim/interpolators.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _read(datafile):
elif ext == ".npz":
return _read_npz(datafile)
else:
raise ValueError(f"File type '{ext}' not supported.")
raise ValueError(f"File type {ext!r} not supported.")


class Interpolator:
Expand Down
2 changes: 1 addition & 1 deletion hera_sim/sigchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ def vary_gains_in_time(
elif mode == "noiselike":
envelope *= stats.norm.rvs(1, amp, times.size)
else:
raise NotImplementedError(f"Variation mode '{mode}' not supported.")
raise NotImplementedError(f"Variation mode {mode!r} not supported.")

if parameter in ("amp", "phs"):
envelope = np.outer(envelope, np.ones(gain_shape[-1]))
Expand Down
2 changes: 1 addition & 1 deletion hera_sim/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ def _get_component(
return get_model(component)
except KeyError:
raise ValueError(
f"The model '{component}' does not exist. The following models are "
f"The model {component!r} does not exist. The following models are "
f"available: \n{list_all_components()}."
)
elif isinstance(component, SimulationComponent):
Expand Down
2 changes: 1 addition & 1 deletion hera_sim/tests/test_interpolators.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_1d_interpolators_bad_file_ext(freqs, model, interpolator, tmp_path):
with pytest.raises(AssertionError) as err:
INTERPOLATORS[model](data_file, interpolator=interpolator)
article = {"poly1d": "a", "interp1d": "an"}[interpolator]
assert f"In order to use {article} '{interpolator}' object" in err.value.args[0]
assert f"In order to use {article} {interpolator!r} object" in err.value.args[0]


@pytest.mark.parametrize("model", ["beam", "bandpass"])
Expand Down
2 changes: 1 addition & 1 deletion hera_sim/visibilities/simulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def load_simulator_from_yaml(config: Path | str) -> VisibilitySimulator:
simulator_cls = getattr(vis, simulator_cls)
except AttributeError:
raise AttributeError(
f"The given simulator '{simulator_cls}' is not available in hera_sim."
f"The given simulator {simulator_cls!r} is not available in hera_sim."
)
else: # pragma: nocover
module = ".".join(simulator_cls.split(".")[:-1])
Expand Down

0 comments on commit ac9fed1

Please sign in to comment.