climate-ref 0.5.1__py3-none-any.whl → 0.5.2__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/config.py CHANGED
@@ -74,11 +74,13 @@ class PathConfig:
74
74
  /// admonition | Warning
75
75
  type: warning
76
76
 
77
- These paths must be common across all systems that the REF is being run
77
+ These paths must be common across all systems that the REF is being run.
78
+ Generally, this means that they should be mounted in the same location on all systems.
78
79
  ///
79
80
 
80
81
  If any of these paths are specified as relative paths,
81
82
  they will be resolved to absolute paths.
83
+ These absolute paths will be used for all operations in the REF.
82
84
  """
83
85
 
84
86
  log: Path = env_field(name="LOG_ROOT", converter=ensure_absolute_path)
@@ -157,12 +159,12 @@ class ExecutorConfig:
157
159
 
158
160
  executor: str = env_field(name="EXECUTOR", default="climate_ref.executor.LocalExecutor")
159
161
  """
160
- Executor to use for running diagnostics
162
+ Executor class to use for running diagnostics
161
163
 
162
164
  This should be the fully qualified name of the executor class
163
165
  (e.g. `climate_ref.executor.LocalExecutor`).
164
- The default is to use the local executor.
165
- The environment variable `REF_EXECUTOR` takes precedence over this configuration value.
166
+ The default is to use the local executor which runs the executions locally, in-parallel
167
+ using a process pool.
166
168
 
167
169
  This class will be used for all executions of diagnostics.
168
170
  """
@@ -172,6 +174,7 @@ class ExecutorConfig:
172
174
  Additional configuration for the executor.
173
175
 
174
176
  See the documentation for the executor for the available configuration options.
177
+ These options will be passed to the executor class when it is created.
175
178
  """
176
179
 
177
180
  def build(self, config: "Config", database: "Database") -> Executor:
@@ -199,7 +202,30 @@ class ExecutorConfig:
199
202
  @define
200
203
  class DiagnosticProviderConfig:
201
204
  """
202
- Configuration for the diagnostic providers
205
+ Defining the diagnostic providers used by the REF.
206
+
207
+ Each diagnostic provider is a package that contains the logic for running a specific
208
+ set of diagnostics.
209
+ This configuration determines which diagnostic providers are loaded and used when solving.
210
+
211
+ Multiple diagnostic providers can be specified as shown in the example below.
212
+
213
+ ```toml
214
+ [[diagnostic_providers]]
215
+ provider = "climate_ref_esmvaltool.provider"
216
+
217
+ [diagnostic_providers.config]
218
+
219
+ [[diagnostic_providers]]
220
+ provider = "climate_ref_ilamb.provider"
221
+
222
+ [diagnostic_providers.config]
223
+
224
+ [[diagnostic_providers]]
225
+ provider = "climate_ref_pmp.provider"
226
+
227
+ [diagnostic_providers.config]
228
+ ```
203
229
  """
204
230
 
205
231
  provider: str
@@ -224,21 +250,29 @@ class DbConfig:
224
250
  """
225
251
  Database configuration
226
252
 
227
- We currently only plan to support SQLite and PostgreSQL databases,
228
- although only SQLite is currently implemented and tested.
253
+ We support SQLite and PostgreSQL databases.
254
+ The default is to use SQLite, which is a file-based database that is stored in the
255
+ `REF_CONFIGURATION` directory.
256
+ This is a good option for testing and development, but not recommended for production use.
257
+
258
+ For production use, we recommend using PostgreSQL.
229
259
  """
230
260
 
231
261
  database_url: str = env_field(name="DATABASE_URL")
232
262
  """
233
263
  Database URL that describes the connection to the database.
234
264
 
235
- Defaults to sqlite:///{config.paths.db}/climate_ref.db".
265
+ Defaults to `sqlite:///{config.paths.db}/climate_ref.db`.
236
266
  This configuration value will be overridden by the `REF_DATABASE_URL` environment variable.
237
267
 
238
- ## Schemas
268
+ **Schemas**
239
269
 
270
+ The following schemas are supported:
271
+ ```
240
272
  postgresql://USER:PASSWORD@HOST:PORT/NAME
273
+
241
274
  sqlite:///RELATIVE_PATH or sqlite:////ABS_PATH or sqlite:///:memory:
275
+ ```
242
276
  """
243
277
  run_migrations: bool = field(default=True)
244
278
 
@@ -285,12 +319,10 @@ def _load_config(config_file: str | Path, doc: dict[str, Any]) -> "Config":
285
319
  return _converter_defaults_relaxed.structure(doc, Config)
286
320
 
287
321
 
288
- @define
322
+ @define(auto_attribs=True)
289
323
  class Config:
290
324
  """
291
- REF configuration
292
-
293
- This class is used to store the configuration of the REF application.
325
+ Configuration that is used by the REF
294
326
  """
295
327
 
296
328
  log_level: str = field(default="INFO")
@@ -1,4 +1,3 @@
1
- import alembic_postgresql_enum # noqa
2
1
  from alembic import context, op
3
2
  from loguru import logger
4
3
  from sqlalchemy import Connection, inspect
@@ -9,6 +8,11 @@ from climate_ref.models import Base, MetricValue
9
8
  from climate_ref_core.logging import capture_logging
10
9
  from climate_ref_core.pycmec.controlled_vocabulary import CV
11
10
 
11
+ try:
12
+ import alembic_postgresql_enum # noqa
13
+ except ImportError:
14
+ logger.warning("alembic_postgresql_enum not installed, skipping enum migration support")
15
+
12
16
  # Setup logging
13
17
  capture_logging()
14
18
  logger.debug("Running alembic env")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climate-ref
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Application which runs 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: Apache-2.0
@@ -30,15 +30,19 @@ Requires-Dist: sqlalchemy>=2.0.36
30
30
  Requires-Dist: tomlkit>=0.13.2
31
31
  Requires-Dist: tqdm>=4.67.1
32
32
  Requires-Dist: typer>=0.12.5
33
+ Provides-Extra: aft-providers
34
+ Requires-Dist: climate-ref-esmvaltool>=0.5.0; extra == 'aft-providers'
35
+ Requires-Dist: climate-ref-ilamb>=0.5.0; extra == 'aft-providers'
36
+ Requires-Dist: climate-ref-pmp>=0.5.0; extra == 'aft-providers'
33
37
  Provides-Extra: celery
34
38
  Requires-Dist: climate-ref-celery>=0.5.0; extra == 'celery'
35
- Provides-Extra: metrics
36
- Requires-Dist: climate-ref-esmvaltool>=0.5.0; extra == 'metrics'
37
- Requires-Dist: climate-ref-ilamb>=0.5.0; extra == 'metrics'
38
- Requires-Dist: climate-ref-pmp>=0.5.0; extra == 'metrics'
39
39
  Provides-Extra: postgres
40
40
  Requires-Dist: alembic-postgresql-enum>=1.7.0; extra == 'postgres'
41
41
  Requires-Dist: psycopg2-binary>=2.9.2; extra == 'postgres'
42
+ Provides-Extra: providers
43
+ Requires-Dist: climate-ref-esmvaltool>=0.5.0; extra == 'providers'
44
+ Requires-Dist: climate-ref-ilamb>=0.5.0; extra == 'providers'
45
+ Requires-Dist: climate-ref-pmp>=0.5.0; extra == 'providers'
42
46
  Description-Content-Type: text/markdown
43
47
 
44
48
  # Climate REF (Rapid Evaluation Framework)
@@ -64,7 +68,7 @@ pip install climate-ref
64
68
  If you want to use the diagnostic providers for the Assessment Fast Track, you can install them with:
65
69
 
66
70
  ```bash
67
- pip install climate-ref[metrics]
71
+ pip install climate-ref[aft-providers]
68
72
  ```
69
73
 
70
74
  ## Quick Start
@@ -1,7 +1,7 @@
1
1
  climate_ref/__init__.py,sha256=OJl5EnjLyEoCQpa0zQ8edV8EcU2YxBJ0xjermIlm9Bw,820
2
2
  climate_ref/_config_helpers.py,sha256=-atI5FX7SukhLE_jz_rL-EHQ7s0YYqKu3dSFYWxSyMU,6632
3
3
  climate_ref/alembic.ini,sha256=WRvbwSIFuZ7hWNMnR2-yHPJAwYUnwhvRYBzkJhtpGdg,3535
4
- climate_ref/config.py,sha256=kvF1DOsMDwic_AZiG6IOZ1tWbrQfE0iRrK-uRn-mNDc,15028
4
+ climate_ref/config.py,sha256=cOJOYXoxF3T73xoRIKZUZUOCCUAG12abKTCCRpQdfA8,16112
5
5
  climate_ref/constants.py,sha256=9RaNLgUSuQva7ki4eRW3TjOKeVP6T81QNiu0veB1zVk,111
6
6
  climate_ref/database.py,sha256=LJ6s5qSPJz4yaCzNjJZ-Mw71hquhnx0IKW32VulkuIs,7293
7
7
  climate_ref/provider_registry.py,sha256=0oVHQrnFenEQhCUqhrZAUnF6r83VCbXrQVbbo8Bh96c,4109
@@ -28,7 +28,7 @@ climate_ref/executor/local.py,sha256=W62scL2UTtBurhYQz9hVIHrYiq9-FeMKRdnajqiohN0
28
28
  climate_ref/executor/result_handling.py,sha256=UxhOTTe1a1p1sU1mZuFTChvhz06CbjY_NFl9BuWYj48,7885
29
29
  climate_ref/executor/synchronous.py,sha256=o4TndsoKMu9AzJYLkusU9lRkgHCy6HcCP46tEs6o86U,1895
30
30
  climate_ref/migrations/README,sha256=xM5osYbyEbEFA2eh5kwary_oh-5VFWtDubA-vgWwvlE,935
31
- climate_ref/migrations/env.py,sha256=I3anCdIHAZlYDXpTrAeHlNieLd7-0t_xknuG1tzgNWE,4252
31
+ climate_ref/migrations/env.py,sha256=8GvBLhGTuQy6MKYMj7QszJEQ2LNewf1Z9kB9dBHQs9I,4375
32
32
  climate_ref/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
33
33
  climate_ref/migrations/versions/2025-05-02T1418_341a4aa2551e_regenerate.py,sha256=S8Q4THCI4TPnlaQHgQJUCiNW5LAyQClaiTB-0dwhtXU,14050
34
34
  climate_ref/migrations/versions/2025-05-09T2032_03dbb4998e49_series_metric_value.py,sha256=s9nZ_l64pSF7sWN53rRPCQlqW_xHqR8tlWhU-ovmsME,2043
@@ -39,9 +39,9 @@ climate_ref/models/diagnostic.py,sha256=YB6xzbEXdpz2j-Ddf19RV8mAiWBrkmtRmiAEUV3t
39
39
  climate_ref/models/execution.py,sha256=lRCpaKLSR7rZbuoL94GW76tm9wLMsSDoIOA7bIa6xgY,9848
40
40
  climate_ref/models/metric_value.py,sha256=44OLcZz-qLx-p_9w7YWDKpD5S7Y9HyTKKsvSb77RBro,10190
41
41
  climate_ref/models/provider.py,sha256=RAE2qAAxwObu-72CdK4kt5ACMmKYEn07WJm7DU9hF28,990
42
- climate_ref-0.5.1.dist-info/METADATA,sha256=nOjrD0Q5EZuPUJO3pnmtaRNEkYP-CWKnnn4Q6kh-VAU,4123
43
- climate_ref-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
- climate_ref-0.5.1.dist-info/entry_points.txt,sha256=IaggEJlDIhoYWXdXJafacWbWtCcoEqUKceP1qD7_7vU,44
45
- climate_ref-0.5.1.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- climate_ref-0.5.1.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
47
- climate_ref-0.5.1.dist-info/RECORD,,
42
+ climate_ref-0.5.2.dist-info/METADATA,sha256=_VM9gflxr_w6CvvSP7ZBGK_xyIzF_K80nXhvmCtUhxA,4368
43
+ climate_ref-0.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
+ climate_ref-0.5.2.dist-info/entry_points.txt,sha256=IaggEJlDIhoYWXdXJafacWbWtCcoEqUKceP1qD7_7vU,44
45
+ climate_ref-0.5.2.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
+ climate_ref-0.5.2.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
47
+ climate_ref-0.5.2.dist-info/RECORD,,