Skip to content

Commit

Permalink
Merge branch 'develop' into fix/init-version-import
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult authored Oct 26, 2024
2 parents 50dfc7e + f247c60 commit 4b3fd75
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Keep it human-readable, your future self will thank you!

- Add more attributes to typed variables
- Fix `__version__` import in init
- Update copyright notice
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ pip install anemoi-transform
## License

```
Copyright 2022, European Centre for Medium Range Weather Forecasts.
Copyright 2024, Anemoi contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 9 additions & 0 deletions dev/dev.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# (C) Copyright 2024 Anemoi contributors.
#
# 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.

from anemoi.transform.filters import filter_factory
from anemoi.transform.sources import source_factory
from anemoi.transform.workflows import workflow_factory
Expand Down
5 changes: 2 additions & 3 deletions src/anemoi/transform/commands/hello.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python
# (C) Copyright 2024 ECMWF.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
#


from . import Command
Expand Down
4 changes: 3 additions & 1 deletion src/anemoi/transform/filter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
Expand Down
4 changes: 3 additions & 1 deletion src/anemoi/transform/filters/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/transform/filters/uv_to_ddff.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# (C) Copyright 2024 ECMWF.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
#


from earthkit.meteo.wind.array import polar_to_xy
Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/transform/grids/unstructured.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# (C) Copyright 2024 ECMWF.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
#


import logging
Expand Down
4 changes: 4 additions & 0 deletions src/anemoi/transform/registry.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# (C) Copyright 2024 Anemoi contributors.
#
# 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.


import importlib
import logging
import os
Expand Down
5 changes: 4 additions & 1 deletion src/anemoi/transform/source.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.


from .transform import Transform


Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/transform/sources/mars.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# (C) Copyright 2024 ECMWF.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
#


import earthkit.data as ekd
Expand Down
4 changes: 3 additions & 1 deletion src/anemoi/transform/transform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
Expand Down
23 changes: 23 additions & 0 deletions src/anemoi/transform/variables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ def level(self):
def is_constant_in_time(self):
pass

@property
@abstractmethod
def is_instantanous(self):
pass

@property
def is_valid_over_a_period(self):
return not self.is_instantanous

@property
@abstractmethod
def is_accumulation(self):
pass

# This may need to move to a different class
@property
def grib_keys(self):
raise NotImplementedError(f"Method `grib_keys` not implemented for {self.__class__.__name__}")

@property
def is_computed_forcing(self):
raise NotImplementedError(f"Method `is_computed_forcing` not implemented for {self.__class__.__name__}")

@property
def is_from_input(self):
pass
10 changes: 8 additions & 2 deletions src/anemoi/transform/variables/variables.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
Expand Down Expand Up @@ -41,9 +43,13 @@ def is_computed_forcing(self):
def is_accumulation(self):
return self.data.get("process") == "accumulation"

@property
def is_instantanous(self):
return "process" not in self.data.get

@property
def grib_keys(self):
return self.data.get("mars", {})
return self.data.get("mars", {}).copy()


class VariableFromDict(VariableFromMarsVocabulary):
Expand Down
5 changes: 4 additions & 1 deletion src/anemoi/transform/workflow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.


from .transform import Transform


Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/transform/workflows/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# (C) Copyright 2024 ECMWF.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.
#


from ..workflow import Workflow
Expand Down
5 changes: 4 additions & 1 deletion tests/test_grids.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.


import earthkit.data as ekd

from anemoi.transform.grids import UnstructuredGridFieldList
Expand Down
5 changes: 4 additions & 1 deletion tests/test_variables.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# (C) Copyright 2024 European Centre for Medium-Range Weather Forecasts.
# (C) Copyright 2024 Anemoi contributors.
#
# 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.


from anemoi.transform.variables import Variable


Expand Down

0 comments on commit 4b3fd75

Please sign in to comment.