Skip to content

Commit

Permalink
Correct format errors flagged by the linter
Browse files Browse the repository at this point in the history
I can't seem to get my editor to read the flake8 config file, otherwise
I would setup autoformat on save.
  • Loading branch information
php1ic committed Aug 17, 2024
1 parent a97f168 commit 2fb061c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pynch/ame_mass_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def read_file(self) -> pd.DataFrame:
lines = [line.rstrip() for line in f]

# Remove the header lines
lines = lines[self.HEADER : self.FOOTER]
lines = lines[self.HEADER: self.FOOTER]

return pd.DataFrame([self._read_line(line) for line in lines])
2 changes: 1 addition & 1 deletion pynch/ame_reaction_1_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def read_file(self) -> pd.DataFrame:
lines = [line.rstrip() for line in f]

# Remove the header lines
lines = lines[self.HEADER : self.FOOTER]
lines = lines[self.HEADER: self.FOOTER]

return pd.DataFrame([self._read_line(line) for line in lines])
2 changes: 1 addition & 1 deletion pynch/ame_reaction_2_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def read_file(self) -> pd.DataFrame:
lines = [line.rstrip() for line in f]

# Remove the header lines and the footer for the 2020 table
lines = lines[self.HEADER : self.FOOTER]
lines = lines[self.HEADER: self.FOOTER]

# The 2020 rct2 file has additional lines feeds not present in any other file
the_lines = [line for line in lines if line[:1] != "1"]
Expand Down
18 changes: 9 additions & 9 deletions pynch/nubase_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _read_decay_string(self, line: str) -> str:
def _read_line(self, line: str) -> dict:
"""Read a line of the file."""
# Ignore isomers for the moment
state = self._read_as_int(line, self.START_STATE, self.END_STATE)
state = self._read_as_int(line, self.START_STATE, self.END_STATE)
if state is None or state > 0:
return dict()

Expand All @@ -92,25 +92,25 @@ def _read_line(self, line: str) -> dict:
line = line.replace("#", " ")

data = {
"Experimental" : exp,
"Experimental": exp,
"TableYear": self.year,
"A" : self._read_as_int(line, self.START_A, self.END_A),
"Z" : self._read_as_int(line, self.START_Z, self.END_Z),
"NubaseMassExcess" : self._read_as_float(line, self.START_ME, self.END_ME),
"NubaseMassExcessError" : self._read_as_float(line, self.START_DME, self.END_DME),
"A": self._read_as_int(line, self.START_A, self.END_A),
"Z": self._read_as_int(line, self.START_Z, self.END_Z),
"NubaseMassExcess": self._read_as_float(line, self.START_ME, self.END_ME),
"NubaseMassExcessError": self._read_as_float(line, self.START_DME, self.END_DME),
# "LevelEnergy" : self._read_as_float(,
# line, self.START_ISOMER, self.END_ISOMER
# )
# "LevelEnergyError" : self._read_as_float(,
# line, self.START_DISOMER, self.END_DISOMER
# )
"LevelSpin" : self._read_spin(line),
"DiscoveryYear" : (
"LevelSpin": self._read_spin(line),
"DiscoveryYear": (
self._read_as_int(line, self.START_YEAR, self.END_YEAR, default=1900)
if self.year != 2003
else 1900
),
"Decay" : self._read_decay_string(line),
"Decay": self._read_decay_string(line),
}

data["HalfLifeValue"], data["HalfLifeUnit"], data["HalfLifeError"] = self._read_all_halflife_data(line)
Expand Down

0 comments on commit 2fb061c

Please sign in to comment.