Skip to content

Commit

Permalink
added remarklint to pre-commit. linted everything.
Browse files Browse the repository at this point in the history
  • Loading branch information
cylammarco committed Mar 24, 2023
1 parent f906641 commit d82a640
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 350 deletions.
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ repos:
# Python checks
- id: debug-statements
- id: requirements-txt-fixer

- repo: local
hooks:
- id: remarklint
name: remarklint
language: node
entry: remark
types: [markdown]
args: ["--frail", "--quiet"]
additional_dependencies:
[
remark,
remark-lint,
remark-cli,
remark-preset-lint-recommended,
remark-lint-list-item-indent,
remark-lint-no-undefined-references,
]
16 changes: 0 additions & 16 deletions src/rascal/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,39 +152,32 @@ def add(
"""

if min_atlas_wavelength is None:

min_atlas_wavelength = (
self.min_atlas_wavelength - self.range_tolerance
)

if max_atlas_wavelength is None:

max_atlas_wavelength = (
self.max_atlas_wavelength + self.range_tolerance
)

if not np.isfinite(min_atlas_wavelength):

raise ValueError(
"min_atlas_wavelength has to be finite or None. "
"{} is given.".format(min_atlas_wavelength)
)

if not np.isfinite(max_atlas_wavelength):

raise ValueError(
"max_atlas_wavelength has to be finite or None. "
"{} is given.".format(max_atlas_wavelength)
)

if isinstance(elements, str):

elements = [elements]

if elements is not None:

for element in elements:

(
atlas_elements_tmp,
atlas_tmp,
Expand Down Expand Up @@ -254,21 +247,16 @@ def add_user_atlas(
"""

if not isinstance(elements, list):

elements = list(elements)

if not isinstance(wavelengths, list):

wavelengths = list(wavelengths)

if intensities is None:

intensities = [0] * len(wavelengths)

else:

if not isinstance(intensities, list):

intensities = list(intensities)

assert len(elements) == len(wavelengths), ValueError(
Expand All @@ -279,7 +267,6 @@ def add_user_atlas(
)

if vacuum:

wavelengths = vacuum_to_air_wavelength(
wavelengths, temperature, pressure, relative_humidity
)
Expand Down Expand Up @@ -338,9 +325,7 @@ def remove_atlas_lines_range(self, wavelength, tolerance=10):
"""

for atlas_line in self.atlas_lines:

if abs(atlas_line.wavelength - wavelength) < tolerance:

self.atlas_lines.remove(atlas_line)

def list(self):
Expand All @@ -350,7 +335,6 @@ def list(self):
"""

for line in self.atlas_lines:

print(
"Element "
+ str(line.element)
Expand Down
Loading

0 comments on commit d82a640

Please sign in to comment.