Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Feb 16, 2024
1 parent bf985b9 commit 75196ec
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 313 deletions.
8 changes: 2 additions & 6 deletions ecml_tools/create/functions/actions/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ def normalise_time_to_hours(r):
return r


def constants(context, dates, **request):
param = request["param"]

template = get_template_field(request)

print(f"✅ load_source(constants, {template}, {request}")
def constants(context, dates, template, param):
print(f"✅ load_source(constants, {template}, {param}")
return load_source("constants", source_or_dataset=template, date=dates, param=param)


Expand Down
2 changes: 0 additions & 2 deletions ecml_tools/create/functions/actions/opendap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


def opendap(context, dates, url_pattern, *args, **kwargs):

all_urls = Pattern(url_pattern, ignore_missing_keys=True).substitute(
*args, date=dates, **kwargs
)
Expand All @@ -22,7 +21,6 @@ def opendap(context, dates, url_pattern, *args, **kwargs):
levels = kwargs.get("level", kwargs.get("levelist"))

for url in all_urls:

print("URL", url)
s = load_source("opendap", url)
s = s.sel(
Expand Down
15 changes: 15 additions & 0 deletions ecml_tools/create/functions/steps/rotate_winds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# (C) Copyright 2024 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.
#


def execute(context, input, **kwargs):
print("🧭", input, kwargs)
for f in input:
print(f)
return input
Loading

0 comments on commit 75196ec

Please sign in to comment.