Skip to content

Commit

Permalink
Merge pull request #70 from roocs/apply_fixes_option
Browse files Browse the repository at this point in the history
Apply fixes option
  • Loading branch information
ellesmith88 committed Dec 3, 2020
2 parents 993cf2c + 1509251 commit 1c4b76f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changes
*******

Unreleased
==========
* ``apply_fixes`` option added for WPS processes and the ``Operator`` class.

0.2.0 (2020-11-19)
==================

Expand Down
5 changes: 2 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ dependencies:
- psutil
# tests
- pytest
# daops
- rtree>=0.9
- cfunits
- cftime>=1.2.1
- udunits2>=2.2
- xarray>=0.16
- dask>=2.26
- netcdf4>=1.4
- daops>=0.3.0,<0.4
- clisops>=0.4.0,<0.5
#- daops>=0.3.0,<0.4
# - clisops>=0.4.0,<0.5
# workflow
- networkx
# provenance
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ networkx
xarray>=0.15
dask[complete]
netcdf4
daops>=0.3.0
clisops>=0.4.0
roocs-utils>=0.1.5
# daops>=0.3.0
# clisops>=0.4.0
# roocs-utils>=0.1.5
prov>=2.0.0
pydot
3 changes: 2 additions & 1 deletion rook/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@


class Operator(object):
def __init__(self, output_dir):
def __init__(self, output_dir, apply_fixes=True):
self.config = {
'output_dir': output_dir,
'apply_fixes': apply_fixes
# 'chunk_rules': dconfig.chunk_rules,
# 'filenamer': dconfig.filenamer,
}
Expand Down
5 changes: 5 additions & 0 deletions rook/processes/wps_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def __init__(self):
default='0',
min_occurs=1,
max_occurs=1),
LiteralInput('apply_fixes', 'Apply Fixes', data_type='boolean',
abstract='Apply fixes to datasets.',
default='1',
min_occurs=1,
max_occurs=1),
]
outputs = [
ComplexOutput('output', 'METALINK v4 output',
Expand Down
6 changes: 6 additions & 0 deletions rook/processes/wps_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def __init__(self):
default='0',
min_occurs=1,
max_occurs=1),
LiteralInput('apply_fixes', 'Apply Fixes', data_type='boolean',
abstract='Apply fixes to datasets.',
default='1',
min_occurs=1,
max_occurs=1),
]
outputs = [
ComplexOutput('output', 'METALINK v4 output',
Expand Down Expand Up @@ -86,6 +91,7 @@ def _handler(self, request, response):

config_args = {
'output_dir': self.workdir,
'apply_fixes': request.inputs['apply_fixes'][0].data
# 'chunk_rules': dconfig.chunk_rules,
# 'filenamer': dconfig.filenamer,
}
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
"daops @ git+https://github.com/roocs/daops.git",
"clisops @ git+https://github.com/roocs/clisops.git",
"roocs-utils @ git+https://github.com/roocs/roocs-utils.git",
reqs,
],
extras_require={
Expand Down

0 comments on commit 1c4b76f

Please sign in to comment.