climate-ref-core 0.6.3__py3-none-any.whl → 0.6.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- climate_ref_core/providers.py +8 -10
- {climate_ref_core-0.6.3.dist-info → climate_ref_core-0.6.4.dist-info}/METADATA +1 -1
- {climate_ref_core-0.6.3.dist-info → climate_ref_core-0.6.4.dist-info}/RECORD +6 -6
- {climate_ref_core-0.6.3.dist-info → climate_ref_core-0.6.4.dist-info}/WHEEL +0 -0
- {climate_ref_core-0.6.3.dist-info → climate_ref_core-0.6.4.dist-info}/licenses/LICENCE +0 -0
- {climate_ref_core-0.6.3.dist-info → climate_ref_core-0.6.4.dist-info}/licenses/NOTICE +0 -0
climate_ref_core/providers.py
CHANGED
|
@@ -136,7 +136,7 @@ def import_provider(fqn: str) -> DiagnosticProvider:
|
|
|
136
136
|
fqn
|
|
137
137
|
Full package and attribute name of the provider to import
|
|
138
138
|
|
|
139
|
-
For example: `climate_ref_example
|
|
139
|
+
For example: `climate_ref_example:provider` will use the `provider` attribute from the
|
|
140
140
|
`climate_ref_example` package.
|
|
141
141
|
|
|
142
142
|
If only a package name is provided, the default attribute name is `provider`.
|
|
@@ -153,24 +153,22 @@ def import_provider(fqn: str) -> DiagnosticProvider:
|
|
|
153
153
|
:
|
|
154
154
|
DiagnosticProvider instance
|
|
155
155
|
"""
|
|
156
|
-
if "
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
name = "provider"
|
|
156
|
+
if ":" not in fqn:
|
|
157
|
+
fqn = f"{fqn}:provider"
|
|
158
|
+
|
|
159
|
+
entrypoint = importlib.metadata.EntryPoint(name="provider", value=fqn, group="climate-ref.providers")
|
|
161
160
|
|
|
162
161
|
try:
|
|
163
|
-
|
|
164
|
-
provider = getattr(imp, name)
|
|
162
|
+
provider = entrypoint.load()
|
|
165
163
|
if not isinstance(provider, DiagnosticProvider):
|
|
166
164
|
raise InvalidProviderException(fqn, f"Expected DiagnosticProvider, got {type(provider)}")
|
|
167
165
|
return provider
|
|
168
166
|
except ModuleNotFoundError:
|
|
169
167
|
logger.error(f"Module '{fqn}' not found")
|
|
170
|
-
raise InvalidProviderException(fqn,
|
|
168
|
+
raise InvalidProviderException(fqn, "Module not found")
|
|
171
169
|
except AttributeError:
|
|
172
170
|
logger.error(f"Provider '{fqn}' not found")
|
|
173
|
-
raise InvalidProviderException(fqn,
|
|
171
|
+
raise InvalidProviderException(fqn, "Provider not found in module")
|
|
174
172
|
|
|
175
173
|
|
|
176
174
|
class CommandLineDiagnosticProvider(DiagnosticProvider):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climate-ref-core
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Core library for the CMIP Rapid Evaluation Framework
|
|
5
5
|
Author-email: Jared Lewis <jared.lewis@climate-resource.com>, Mika Pflueger <mika.pflueger@climate-resource.com>, Bouwe Andela <b.andela@esciencecenter.nl>, Jiwoo Lee <lee1043@llnl.gov>, Min Xu <xum1@ornl.gov>, Nathan Collier <collierno@ornl.gov>, Dora Hegedus <dora.hegedus@stfc.ac.uk>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -7,7 +7,7 @@ climate_ref_core/env.py,sha256=Ph2dejVxTELfP3bL0xES086WLGvV5H6KvsOwCkL6m-k,753
|
|
|
7
7
|
climate_ref_core/exceptions.py,sha256=7Mkz22P-kbiL-ZevAhlOuQaaeTio6zpwE9YA45OTGvs,1909
|
|
8
8
|
climate_ref_core/executor.py,sha256=QiVOca-d9JxKIktQIinQQYZGr3ecV5mL3nvUwCdMiJQ,5372
|
|
9
9
|
climate_ref_core/logging.py,sha256=cg6CK2DHGjyLaoRJm75p-Ja82hnVhBBQ4riOKk3l9XY,7063
|
|
10
|
-
climate_ref_core/providers.py,sha256=
|
|
10
|
+
climate_ref_core/providers.py,sha256=HZTpz1VFa9yZLPr1Cwofag2TCuwn6P4VPOrBaXbhn0A,12746
|
|
11
11
|
climate_ref_core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
climate_ref_core/metric_values/__init__.py,sha256=aHfwRrqzLOmmaBKf1-4q97DnHb8KwmW0Dhwd79ZQiNQ,634
|
|
13
13
|
climate_ref_core/metric_values/typing.py,sha256=2DpzmjqQ7tqOPAyjthZ_O14c0-MhiYt-A_n9p6-bOao,1903
|
|
@@ -17,8 +17,8 @@ climate_ref_core/pycmec/controlled_vocabulary.py,sha256=_GZ2Y6KAYF12I3IS27g8YdFB
|
|
|
17
17
|
climate_ref_core/pycmec/cv_cmip7_aft.yaml,sha256=gx5QyW88pZQVUfiYXmsJtJO6AJg6NbIZgdU4vDIa3fE,4390
|
|
18
18
|
climate_ref_core/pycmec/metric.py,sha256=zymXoutnjbdcxvG_fMJugFLLcBrfSPG0XoV-2tA0ujA,18499
|
|
19
19
|
climate_ref_core/pycmec/output.py,sha256=4-RQ439sfgNLeQZVDPB1pewF_kTwX7nCK0Z4U6bvbd0,5709
|
|
20
|
-
climate_ref_core-0.6.
|
|
21
|
-
climate_ref_core-0.6.
|
|
22
|
-
climate_ref_core-0.6.
|
|
23
|
-
climate_ref_core-0.6.
|
|
24
|
-
climate_ref_core-0.6.
|
|
20
|
+
climate_ref_core-0.6.4.dist-info/METADATA,sha256=oYXP9COnofum1dw4zCrilxEK0AAC33wr032prB-z2-U,2930
|
|
21
|
+
climate_ref_core-0.6.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
22
|
+
climate_ref_core-0.6.4.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
23
|
+
climate_ref_core-0.6.4.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
|
|
24
|
+
climate_ref_core-0.6.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|