climdata 0.0.7__tar.gz → 0.1.1__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.

Files changed (56) hide show
  1. {climdata-0.0.7 → climdata-0.1.1}/PKG-INFO +1 -1
  2. {climdata-0.0.7 → climdata-0.1.1}/climdata/__init__.py +1 -1
  3. {climdata-0.0.7 → climdata-0.1.1}/climdata/datasets/CMIPCloud.py +29 -0
  4. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/PKG-INFO +1 -1
  5. climdata-0.1.1/examples/extract_dwd_loc.ipynb +2429 -0
  6. {climdata-0.0.7 → climdata-0.1.1}/pyproject.toml +2 -2
  7. climdata-0.0.7/examples/extract_dwd_loc.ipynb +0 -549
  8. {climdata-0.0.7 → climdata-0.1.1}/.editorconfig +0 -0
  9. {climdata-0.0.7 → climdata-0.1.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  10. {climdata-0.0.7 → climdata-0.1.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  11. {climdata-0.0.7 → climdata-0.1.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  12. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/docs-build.yml +0 -0
  13. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/docs.yml +0 -0
  14. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/installation.yml +0 -0
  15. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/macos.yml +0 -0
  16. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/pypi.yml +0 -0
  17. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/ubuntu.yml +0 -0
  18. {climdata-0.0.7 → climdata-0.1.1}/.github/workflows/windows.yml +0 -0
  19. {climdata-0.0.7 → climdata-0.1.1}/.gitignore +0 -0
  20. {climdata-0.0.7 → climdata-0.1.1}/LICENSE +0 -0
  21. {climdata-0.0.7 → climdata-0.1.1}/MANIFEST.in +0 -0
  22. {climdata-0.0.7 → climdata-0.1.1}/README.md +0 -0
  23. {climdata-0.0.7 → climdata-0.1.1}/climdata/__main__.py +0 -0
  24. {climdata-0.0.7 → climdata-0.1.1}/climdata/conf/config.yaml +0 -0
  25. {climdata-0.0.7 → climdata-0.1.1}/climdata/conf/mappings/parameters.yaml +0 -0
  26. {climdata-0.0.7 → climdata-0.1.1}/climdata/conf/mappings/variables.yaml +0 -0
  27. {climdata-0.0.7 → climdata-0.1.1}/climdata/datasets/CMIPlocal.py +0 -0
  28. {climdata-0.0.7 → climdata-0.1.1}/climdata/datasets/DWD.py +0 -0
  29. {climdata-0.0.7 → climdata-0.1.1}/climdata/datasets/ERA5.py +0 -0
  30. {climdata-0.0.7 → climdata-0.1.1}/climdata/datasets/MSWX.py +0 -0
  31. {climdata-0.0.7 → climdata-0.1.1}/climdata/main.py +0 -0
  32. {climdata-0.0.7 → climdata-0.1.1}/climdata/utils/__init__.py +0 -0
  33. {climdata-0.0.7 → climdata-0.1.1}/climdata/utils/config.py +0 -0
  34. {climdata-0.0.7 → climdata-0.1.1}/climdata/utils/utils_download.py +0 -0
  35. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/SOURCES.txt +0 -0
  36. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/dependency_links.txt +0 -0
  37. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/entry_points.txt +0 -0
  38. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/requires.txt +0 -0
  39. {climdata-0.0.7 → climdata-0.1.1}/climdata.egg-info/top_level.txt +0 -0
  40. {climdata-0.0.7 → climdata-0.1.1}/docs/changelog.md +0 -0
  41. {climdata-0.0.7 → climdata-0.1.1}/docs/climdata.md +0 -0
  42. {climdata-0.0.7 → climdata-0.1.1}/docs/common.md +0 -0
  43. {climdata-0.0.7 → climdata-0.1.1}/docs/contributing.md +0 -0
  44. {climdata-0.0.7 → climdata-0.1.1}/docs/faq.md +0 -0
  45. {climdata-0.0.7 → climdata-0.1.1}/docs/index.md +0 -0
  46. {climdata-0.0.7 → climdata-0.1.1}/docs/installation.md +0 -0
  47. {climdata-0.0.7 → climdata-0.1.1}/docs/overrides/main.html +0 -0
  48. {climdata-0.0.7 → climdata-0.1.1}/docs/usage.md +0 -0
  49. {climdata-0.0.7 → climdata-0.1.1}/dwd_tas_LAT52.507_LON14.1372_1989-01-01_2020-12-31.csv +0 -0
  50. {climdata-0.0.7 → climdata-0.1.1}/examples/zarr_tas_data/metadata.json +0 -0
  51. {climdata-0.0.7 → climdata-0.1.1}/mkdocs.yml +0 -0
  52. {climdata-0.0.7 → climdata-0.1.1}/requirements.txt +0 -0
  53. {climdata-0.0.7 → climdata-0.1.1}/requirements_dev.txt +0 -0
  54. {climdata-0.0.7 → climdata-0.1.1}/setup.cfg +0 -0
  55. {climdata-0.0.7 → climdata-0.1.1}/tests/__init__.py +0 -0
  56. {climdata-0.0.7 → climdata-0.1.1}/tests/test_climdata.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climdata
3
- Version: 0.0.7
3
+ Version: 0.1.1
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Kaushik Muduchuru"""
4
4
  __email__ = "kaushik.reddy.m@gmail.com"
5
- __version__ = "0.0.7"
5
+ __version__ = "0.1.1"
6
6
 
7
7
  from .utils.utils_download import * # etc.
8
8
  from .utils.config import load_config
@@ -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"] = self.source_id
135
+ df_long["experiment"] = self.experiment_id
136
+ df_long["table"] = self.table_id
137
+
138
+ # Reorder columns
139
+ cols = ["source", "experiment", "table", "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.7
3
+ Version: 0.1.1
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