Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anomalizer #14

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from
Draft

Anomalizer #14

wants to merge 90 commits into from

Conversation

pstradio
Copy link

Functions to combine a Thematic CDR (for climatology) and a Interim CDR (for operative data) to apply anomalies/percentiles or custom functions and generate stacks with results ready to be plotted

wpreimes and others added 30 commits October 19, 2018 18:34
Update documentation, fix CI
* Update sphinx documentation

* Update .coveragerc

* Update test-requirements.txt
added MIT License
* Update sphinx documentation

* Update .coveragerc

* Update test-requirements.txt

* Change cell grid image

* Update .gitmodules

* Add new submodule

* Change test data path

* Change url to http
* Update sphinx documentation

* Update .coveragerc

* Update test-requirements.txt

* Change cell grid image

* Update .gitmodules

* Add new submodule

* Change test data path

* Change url to http

* Add pyyaml

* Add empty .coveralls.yml

* Add pytest-cov

* add coveralls.yml without token

* Add gitattributes older pytest version

* Change travis installation scheme

* Fix typo

* Update .gitattributes

* Update .travis.yml
Fix docs requirements file name
@pstradio pstradio requested a review from wpreimes April 14, 2022 13:13
@pstradio pstradio marked this pull request as draft April 14, 2022 13:13
@pstradio
Copy link
Author

Re-added xrcube.py script - why was it removed in the first place? Need to adapt code

Copy link
Member

@wpreimes wpreimes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package needs a major overhaul anyway, so I'm not too picky about the updates, but lets still try to keep it clean for the most part ;)

)


if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete if __name__ ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either move to test or to docs if we should keep it

end of the considered period. Format: 'YYYY-mm-dd'
**Note**: defines size of the netCDF stack

Attributes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or fill out

# apply the function which uses the icdr and tcdr
out = funct(icdr_ts, tcdr_ts, **fun_kwargs)

assert type(out) == pd.Series, "The given function should return a Series"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally AssertionErrors should only be raised in Tests

if grid_subset is None:
grid_subset = self.grid

print(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statement or replace with log function

"""

def __init__(self, *args, **kwargs):
self._fillvalue_in = -777777.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to omit this, or can be make this more dynamic?

cellds = self.read_cell(cell, **kwargs)
ds.append(cellds)

print("Combining cell datasets in a global cube")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print -> log

@@ -12,36 +12,42 @@
import pandas as pd
import os

from c3s_sm.interface import fntempl
from interface import fntempl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure that this works?

@@ -592,14 +596,14 @@ def iter_ts(self, **kwargs):
def write_ts(self, *args, **kwargs):
pass


if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@@ -217,24 +229,24 @@ def read_ts(self,
def write_stack(self, out_file, **kwargs):
vars = [v for v in list(self.ds.variables.keys()) if v not in self.ds.coords.keys()]

encoding = {v : {'zlib': True, 'complevel': 6} for v in vars}
encoding = {v: {'zlib': True, 'complevel': 6} for v in vars}

with ProgressBar():
self.ds.to_netcdf(out_file, encoding=encoding, **kwargs)


if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@wpreimes
Copy link
Member

Re-added xrcube.py script - why was it removed in the first place? Need to adapt code

I think that comes from another branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants