Skip to content

Commit

Permalink
Merge pull request #3063 from neutrinoceros/cleanup_flake8_conf
Browse files Browse the repository at this point in the history
Cleanup flake8 conf
  • Loading branch information
cphyc committed Feb 10, 2021
2 parents bd804aa + c3a14bb commit 8b3e5f0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions setup.cfg
Expand Up @@ -27,14 +27,10 @@ exclude = doc,
yt/visualization/_colormap_data.py,

ignore = E203, # Whitespace before ':' (black compatibility)
E231, # Missing whitespace after ',', ';', or ':'
E266, # Too many leading '#' for block comment
E302, # Expected 2 blank lines, found 0
E306, # Expected 1 blank line before a nested definition
E501, # Line too long (let Black deal with line-lenght)
E741, # Do not use variables named 'I', 'O', or 'l'
W503, # Line break occurred before a binary operator (black compatibility)
W605, # Invalid escape sequence 'x'
B302, # this is a python 3 compatibility warning, not relevant since don't support python 2 anymore

jobs=8
2 changes: 2 additions & 0 deletions yt/frontends/athena/fields.py
Expand Up @@ -60,6 +60,7 @@ def setup_fluid_fields(self):
function=velocity_field(comp),
units=unit_system["velocity"],
)

# Add pressure, energy, and temperature fields
def eint_from_etot(data):
eint = data["athena", "total_energy"].copy()
Expand Down Expand Up @@ -133,6 +134,7 @@ def _total_energy(field, data):
function=_total_energy,
units=unit_system["specific_energy"],
)

# Add temperature field
def _temperature(field, data):
return (
Expand Down
1 change: 1 addition & 0 deletions yt/frontends/athena_pp/fields.py
Expand Up @@ -94,6 +94,7 @@ def _thermal_energy(field, data):
function=_thermal_energy,
units=unit_system["specific_energy"],
)

# Add temperature field
def _temperature(field, data):
return (
Expand Down
1 change: 1 addition & 0 deletions yt/frontends/enzo/fields.py
Expand Up @@ -250,6 +250,7 @@ def _ge_plus_kin(field, data):
self.add_output_field(
("enzo", te_name), sampling_type="cell", units="code_velocity**2"
)

# Subtract off B-field energy
def _sub_b(field, data):
ret = data[te_name] - 0.5 * data["velocity_x"] ** 2.0
Expand Down
1 change: 1 addition & 0 deletions yt/frontends/flash/fields.py
Expand Up @@ -95,6 +95,7 @@ def setup_fluid_fields(self):
units="",
display_name=f"Energy Group {i}",
)

# Add energy fields
def ekin(data):
ek = data["flash", "velx"] ** 2
Expand Down
1 change: 1 addition & 0 deletions yt/utilities/answer_testing/utils.py
Expand Up @@ -222,6 +222,7 @@ def _compare_result(data, outputFile):
# Load the saved data
with open(outputFile) as f:
savedData = yaml.safe_load(f)

# Define the comparison function
def _check_vals(newVals, oldVals):
for key, value in newVals.items():
Expand Down
4 changes: 2 additions & 2 deletions yt/visualization/eps_writer.py
Expand Up @@ -436,10 +436,10 @@ def axis_box_yt(
YTQuantity(xlimits[0], "m"),
YTQuantity(xlimits[1], "m"),
) # unit hardcoded but afaik it is not used anywhere so it doesn't matter
if list(plot.axes.ylim.viewvalues())[0][0] is None:
if list(plot.axes.ylim.values())[0][0] is None:
ylimits = subplot.get_ylim()
else:
ylimits = list(plot.axes.ylim.viewvalues())[0]
ylimits = list(plot.axes.ylim.values())[0]
_yrange = (
YTQuantity(ylimits[0], "m"),
YTQuantity(ylimits[1], "m"),
Expand Down

0 comments on commit 8b3e5f0

Please sign in to comment.