climdata 0.0.7__tar.gz → 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of climdata might be problematic. Click here for more details.
- {climdata-0.0.7 → climdata-0.1.0}/PKG-INFO +1 -1
- {climdata-0.0.7 → climdata-0.1.0}/climdata/__init__.py +1 -1
- {climdata-0.0.7 → climdata-0.1.0}/climdata/datasets/CMIPCloud.py +29 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/PKG-INFO +1 -1
- climdata-0.1.0/examples/extract_dwd_loc.ipynb +2429 -0
- {climdata-0.0.7 → climdata-0.1.0}/pyproject.toml +2 -2
- climdata-0.0.7/examples/extract_dwd_loc.ipynb +0 -549
- {climdata-0.0.7 → climdata-0.1.0}/.editorconfig +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/docs-build.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/docs.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/installation.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/macos.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/pypi.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/ubuntu.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.github/workflows/windows.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/.gitignore +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/LICENSE +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/MANIFEST.in +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/README.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/__main__.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/conf/config.yaml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/conf/mappings/parameters.yaml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/conf/mappings/variables.yaml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/datasets/CMIPlocal.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/datasets/DWD.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/datasets/ERA5.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/datasets/MSWX.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/main.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/utils/__init__.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/utils/config.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata/utils/utils_download.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/SOURCES.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/dependency_links.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/entry_points.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/requires.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/climdata.egg-info/top_level.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/changelog.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/climdata.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/common.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/contributing.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/faq.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/index.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/installation.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/overrides/main.html +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/docs/usage.md +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/dwd_tas_LAT52.507_LON14.1372_1989-01-01_2020-12-31.csv +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/examples/zarr_tas_data/metadata.json +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/mkdocs.yml +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/requirements.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/requirements_dev.txt +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/setup.cfg +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/tests/__init__.py +0 -0
- {climdata-0.0.7 → climdata-0.1.0}/tests/test_climdata.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climdata
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: This project automates the fetching and extraction of weather data from multiple sources — such as MSWX, DWD HYRAS, ERA5-Land, NASA-NEX-GDDP, and more — for a given location and time range.
|
|
5
5
|
Author-email: Kaushik Muduchuru <kaushik.reddy.m@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -113,8 +113,37 @@ class CMIPCloud:
|
|
|
113
113
|
self.ds.to_zarr(store_path, mode="w")
|
|
114
114
|
print(f"Saved Zarr to {store_path}")
|
|
115
115
|
|
|
116
|
+
def _format(self, df):
|
|
117
|
+
"""
|
|
118
|
+
Format the dataframe for standardized output:
|
|
119
|
+
- Adds source_id, experiment_id, table_id, variable, value, units columns.
|
|
120
|
+
- Stacks variables into long format.
|
|
121
|
+
"""
|
|
122
|
+
# Melt the dataframe to long format: variable, value
|
|
123
|
+
value_vars = [v for v in self.variables if v in df.columns]
|
|
124
|
+
id_vars = [c for c in df.columns if c not in value_vars]
|
|
125
|
+
df_long = df.melt(id_vars=id_vars, value_vars=value_vars,
|
|
126
|
+
var_name="variable", value_name="value")
|
|
127
|
+
|
|
128
|
+
# Add units column (from attrs)
|
|
129
|
+
df_long["units"] = df_long["variable"].map(
|
|
130
|
+
lambda v: self.ds[v].attrs.get("units", "unknown") if v in self.ds.data_vars else "unknown"
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# Add metadata columns if missing
|
|
134
|
+
df_long["source_id"] = self.source_id
|
|
135
|
+
df_long["experiment_id"] = self.experiment_id
|
|
136
|
+
df_long["table_id"] = self.table_id
|
|
137
|
+
|
|
138
|
+
# Reorder columns
|
|
139
|
+
cols = ["source_id", "experiment_id", "table_id", "time", "lat", "lon", "variable", "value", "units"]
|
|
140
|
+
df_long = df_long[[c for c in cols if c in df_long.columns]]
|
|
141
|
+
|
|
142
|
+
return df_long
|
|
143
|
+
|
|
116
144
|
def save_csv(self, filename):
|
|
117
145
|
if self.ds is not None:
|
|
118
146
|
df = self.ds.to_dataframe().reset_index()
|
|
147
|
+
df = self._format(df)
|
|
119
148
|
df.to_csv(filename, index=False)
|
|
120
149
|
print(f"Saved CSV to {filename}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climdata
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: This project automates the fetching and extraction of weather data from multiple sources — such as MSWX, DWD HYRAS, ERA5-Land, NASA-NEX-GDDP, and more — for a given location and time range.
|
|
5
5
|
Author-email: Kaushik Muduchuru <kaushik.reddy.m@gmail.com>
|
|
6
6
|
License: MIT License
|