Skip to content

Commit

Permalink
changed to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
initze committed Dec 11, 2024
1 parent 503c162 commit 45a57af
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 45 deletions.
13 changes: 0 additions & 13 deletions environment.yml

This file was deleted.

7 changes: 2 additions & 5 deletions noaaplotter/download_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from noaaplotter.utils import dl_noaa_api, assign_numeric_datatypes


def download_from_noaa(output_file, start_date, end_date, datatypes, loc_name, station_id, noaa_api_token, n_jobs=4):
def download_from_noaa(output_file, start_date, end_date, station_id, noaa_api_token, datatypes=['TMIN', 'TMAX', 'PRCP', 'SNOW'], loc_name='', n_jobs=4):
# remove file if exists
if os.path.exists(output_file):
os.remove(output_file)
Expand All @@ -34,9 +34,6 @@ def download_from_noaa(output_file, start_date, end_date, datatypes, loc_name, s
delayed(dl_noaa_api)(i, datatypes, station_id, noaa_api_token, start_date, end_date, split_size)
for i in tqdm.tqdm(split_range[:])
)
# drop empty/None from datasets_list
datasets_list = [i for i in datasets_list if i is not None]

# Merge subsets and create DataFrame
df = pd.concat(datasets_list)

Expand Down Expand Up @@ -92,4 +89,4 @@ def download_era5_from_gee(latitude, longitude, end_date, start_date, output_fil
df_renamed['SNWD'] = ''
output_cols = ["STATION", "NAME", "DATE", "PRCP", "SNWD", "TAVG", "TMAX", "TMIN"]
df_save = df_renamed[output_cols].astype(str)
df_save.to_csv(output_file, index=False)
df_save.to_csv(output_file, index=False)
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = ["setuptools>=75.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "noaaplotter"
version = "0.5.3"
description = "Package to plot fancy climate/weather data of NOAA"
authors = [
{ name = "Ingmar Nitze", email = "[email protected]" }
]
readme = "README.md" # Specify a README file if available
# homepage = "https://github.com/initze/noaaplotter"
keywords = ["climate", "weather", "NOAA", "plotting"]

requires-python = ">=3.10"
dependencies = [
"pandas>=2.2",
"numpy>=2.2",
"matplotlib>=3.9",
"requests",
"joblib>=1.4",
"tqdm>=4.67",
"geemap>=0.35"
]

[tool.setuptools.packages.find]
where = ["noaaplotter"]

[project.scripts]
plot_daily = "scripts.plot_daily:main"
plot_monthly = "scripts.plot_monthly:main"
download_data = "scripts.download_data:main"
download_data_ERA5 = "scripts.download_data_ERA5:main"
27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

0 comments on commit 45a57af

Please sign in to comment.