Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Clément Haëck
submeso-color
Commits
7db99e42
Commit
7db99e42
authored
Mar 10, 2022
by
Clément Haëck
Browse files
Add support for climatology in datasets
change pregex if climato argument is present
parent
ac74978c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lib/data/__init__.py
lib/data/__init__.py
+7
-1
No files found.
lib/data/__init__.py
View file @
7db99e42
...
...
@@ -40,7 +40,13 @@ def create_dataset(module: str, pregex_func: Callable,
return
decorated
# Create function to obtain pre-regex
get_pregex
=
with_args
(
pregex_func
)
@
with_args
def
get_pregex
(
args
):
if
args
.
get
(
'climato'
,
None
)
is
not
None
:
pregex
=
"{0:d}/{0:d}_%(m)%(d).nc"
.
format
(
args
[
'climato'
])
else
:
pregex
=
pregex_func
(
args
)
return
pregex
# Create function to obtain data root directory
@
with_args
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment