Skip to content

Commit

Permalink
fix path in write_excel, write_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-hlsn committed Jan 9, 2024
1 parent 2f248b8 commit 19cae86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions climada/hazard/centroids/centr.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,12 @@ def write_csv(self, file_path):
Parameters
----------
file_path : str
file_path : str, Path
absolute or relative file path and name to write to
"""
LOGGER.info('Writing %s', file_path)
df = self._centroids_to_df()

Check warning on line 728 in climada/hazard/centroids/centr.py

View check run for this annotation

Jenkins - WCR / Pylint

invalid-name

LOW: Variable name "df" doesn't conform to '(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$' pattern
Raw output
Used when the name doesn't match the regular expression associated to its type(constant, variable, class...).
df.to_csv(file_path.with_suffix('.csv'), index=False)
df.to_csv(Path(file_path).with_suffix('.csv'), index=False)


@classmethod
Expand Down Expand Up @@ -760,13 +760,13 @@ def write_excel(self, file_path):
Parameters
----------
file_path : str
file_path : str, Path
absolute or relative file path and name to write to
"""
LOGGER.info('Writing %s', file_path)
df = self._centroids_to_df()

Check warning on line 767 in climada/hazard/centroids/centr.py

View check run for this annotation

Jenkins - WCR / Pylint

invalid-name

LOW: Variable name "df" doesn't conform to '(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$' pattern
Raw output
Used when the name doesn't match the regular expression associated to its type(constant, variable, class...).
df.to_excel(
file_path.with_suffix('.xlsx'),
Path(file_path).with_suffix('.xlsx'),
sheet_name=DEF_SHEET_NAME, index=False
)

Expand Down

0 comments on commit 19cae86

Please sign in to comment.