windborne 1.0.4__tar.gz → 1.0.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {windborne-1.0.4 → windborne-1.0.5}/PKG-INFO +1 -1
- {windborne-1.0.4 → windborne-1.0.5}/pyproject.toml +1 -1
- {windborne-1.0.4 → windborne-1.0.5}/windborne/utils.py +4 -2
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/PKG-INFO +1 -1
- {windborne-1.0.4 → windborne-1.0.5}/README.md +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/setup.cfg +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne/__init__.py +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne/cli.py +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne/config.py +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne/data_api.py +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne/forecasts_api.py +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/SOURCES.txt +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/dependency_links.txt +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/entry_points.txt +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/requires.txt +0 -0
- {windborne-1.0.4 → windborne-1.0.5}/windborne.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "windborne"
|
7
|
-
version = "1.0.
|
7
|
+
version = "1.0.5"
|
8
8
|
description = "A Python library for interacting with WindBorne Data and Forecasts API"
|
9
9
|
readme = {file = "README.md", content-type = "text/markdown"}
|
10
10
|
authors = [
|
@@ -345,6 +345,7 @@ def convert_to_netcdf(data, curtime, output_filename=None):
|
|
345
345
|
for obs_id, obs_data in data.items():
|
346
346
|
# Convert 'None' strings to None type
|
347
347
|
clean_data = {k: None if v == 'None' else v for k, v in obs_data.items()}
|
348
|
+
|
348
349
|
data_list.append(clean_data)
|
349
350
|
|
350
351
|
# Put the data in a panda dataframe in order to easily push to xarray then netcdf output
|
@@ -357,8 +358,6 @@ def convert_to_netcdf(data, curtime, output_filename=None):
|
|
357
358
|
if col in df.columns:
|
358
359
|
df[col] = pd.to_numeric(df[col], errors='coerce')
|
359
360
|
|
360
|
-
df['id'] = pd.to_numeric(df['id'], downcast='integer')
|
361
|
-
|
362
361
|
ds = xr.Dataset.from_dataframe(df)
|
363
362
|
|
364
363
|
# Build the filename and save some variables for use later
|
@@ -392,6 +391,9 @@ def convert_to_netcdf(data, curtime, output_filename=None):
|
|
392
391
|
|
393
392
|
# Now that calculations are done, remove variables not needed in the netcdf output
|
394
393
|
variables_to_drop = ['humidity', 'speed_x', 'speed_y', 'timestamp']
|
394
|
+
if 'id' in ds and pd.isna(ds['id']).all():
|
395
|
+
variables_to_drop.append('id')
|
396
|
+
|
395
397
|
existing_vars = [var for var in variables_to_drop if var in ds]
|
396
398
|
ds = ds.drop_vars(existing_vars)
|
397
399
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|