Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
hwang6 committed Oct 25, 2024
1 parent 70d5f89 commit d0b8f65
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ good-names=_,
yb,
pf,
ds,
cf
cf,
sc

# Include a hint for the correct naming format with invalid-name
include-naming-hint=yes
Expand Down
4 changes: 2 additions & 2 deletions reView/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def validate_breaks_scheme(ctx, param, value):
- the kwargs do not appear to be valid JSON
"""


if value in TECH_CHOICES or value is None:
return value

Expand Down Expand Up @@ -407,7 +406,8 @@ def make_maps(
else:
classifier, classifier_kwargs = breaks_scheme
out_suffix = classifier
# pylint: disable=consider-using-dict-items, consider-iterating-dictionary
# pylint: disable=consider-using-dict-items,
# consider-iterating-dictionary
for map_var in map_vars.keys():
scheme = mc.classify(
supply_curve_gdf[map_var], classifier, **classifier_kwargs
Expand Down
2 changes: 1 addition & 1 deletion reView/layout/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def get_layout():
html.Div(id="page_content"),
navbar.SIDE_BUTTON,
])
return layout
return layout
5 changes: 3 additions & 2 deletions reView/layout/navbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
),
html.A(
html.Img(
src="https://raw.githubusercontent.com/NREL/reView/main/reView/static/nrel_logo.png",
src="""https://raw.githubusercontent.com/NREL/reView/
main/reView/static/nrel_logo.png""",
className="twelve columns",
style={
"height": "70px",
Expand All @@ -118,7 +119,7 @@
],
)

SIDE_BUTTON=html.Div(
SIDE_BUTTON = html.Div(
children=html.Button(
"Additional Scenarios",
id="open_side_options",
Expand Down
11 changes: 5 additions & 6 deletions reView/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import h5py
import pandas as pd
import pyarrow as pa
import pyarrow as pa

from pyarrow.parquet import ParquetFile
from reV.utilities import SupplyCurveField
Expand Down Expand Up @@ -95,8 +95,8 @@ def read_rev(fpath, nrows=None):
if Path(fpath).name.endswith("parquet"):
if nrows:
pf = ParquetFile(fpath)
nrows = next(pf.iter_batches(batch_size=nrows))
sc = pa.Table.from_batches([nrows]).to_pandas()
nrows = next(pf.iter_batches(batch_size=nrows))
sc = pa.Table.from_batches([nrows]).to_pandas()
else:
sc = pd.read_parquet(fpath)
elif Path(fpath).name.endswith("csv"):
Expand Down Expand Up @@ -127,15 +127,15 @@ def __init__(self, project=DEFAULT_PROJECT):
self._check_required_keys_exist()

def __str__(self):
"""Return a Config object's string representation."""
"""Return a Config object's string representation."""
msg = (
f"<reView Config object: "
f"project={self.project!r}, {len(self.files)} files>"
)
return msg

def __repr__(self):
"""Return a Config object's representation string."""
"""Return a Config object's representation string."""
return f"Config({self.project!r})"

@property
Expand Down Expand Up @@ -256,7 +256,6 @@ def name_lookup(self):
@cached_property
def options(self):
"""Return a variable options data frame for dropdown selections
Returns
-------
pd.core.frame.DataFrame or None: DataFrame containing
Expand Down
5 changes: 3 additions & 2 deletions reView/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def strip_rev_filename_endings(filename):
Returns
-------
str :
str :
Filename without the file endings listed above.
Examples
Expand Down Expand Up @@ -592,7 +592,8 @@ def make_col_type(col, types):
else:
coltype = 'f2'
return column.name, coltype
except:
except Exception as e:
print(f"An error occurred: {e}")
print(column.name, coltype, coltype.type, type(column))
raise

Expand Down
3 changes: 1 addition & 2 deletions reView/utils/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def calc_least_cost(paths, dst, composite_function="min",
)
data.to_csv(dst, index=False)


def find_capacity_column(supply_curve_df, cap_col_candidates=None):
"""Find the capacity column in a supply curve data frame.
Expand Down Expand Up @@ -456,5 +457,3 @@ def read_timeseries(file, project, gids=None, nsteps=None,
})

return data


0 comments on commit d0b8f65

Please sign in to comment.