fmu-settings 0.5.0__py3-none-any.whl → 0.5.1__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.

Potentially problematic release.


This version of fmu-settings might be problematic. Click here for more details.

@@ -145,16 +145,18 @@ def load_global_configuration_if_present(
145
145
  fmu_load: Whether or not to load in the custom 'fmu' format. Default False.
146
146
 
147
147
  Returns:
148
- GlobalConfiguration instance or None.
148
+ GlobalConfiguration instance or None if file cannot be loaded.
149
+
150
+ Raises:
151
+ ValidationError: If the file is loaded but has invalid schema.
149
152
  """
150
153
  loader = "fmu" if fmu_load else "standard"
151
154
  try:
152
155
  global_variables_dict = yaml_load(path, loader=loader)
153
156
  global_config = GlobalConfiguration.model_validate(global_variables_dict)
154
157
  logger.debug(f"Global variables at {path} has valid settings data")
155
- except ValidationError as e:
156
- logger.debug(f"Global variables at {path} failed validation: {e}")
157
- return None
158
+ except ValidationError:
159
+ raise
158
160
  except Exception as e:
159
161
  logger.debug(
160
162
  f"Failed to load global variables at {path}: {type(e).__name__}: {e}"
@@ -173,6 +175,9 @@ def _find_global_variables_file(paths: list[Path]) -> GlobalConfiguration | None
173
175
 
174
176
  Returns:
175
177
  A validated GlobalConfiguration or None.
178
+
179
+ Raises:
180
+ ValidationError: If a file is found but has invalid schema.
176
181
  """
177
182
  for path in paths:
178
183
  if not path.exists():
@@ -204,6 +209,9 @@ def _find_global_config_file(paths: list[Path]) -> GlobalConfiguration | None:
204
209
 
205
210
  Returns:
206
211
  A validated GlobalConfiguration or None.
212
+
213
+ Raises:
214
+ ValidationError: If a file is found but has invalid schema.
207
215
  """
208
216
  for path in paths:
209
217
  if not path.exists():
@@ -241,6 +249,11 @@ def find_global_config(
241
249
 
242
250
  Returns:
243
251
  A valid GlobalConfiguration instance, or None.
252
+
253
+ Raises:
254
+ ValidationError: If a configuration file is found but has invalid schema.
255
+ InvalidGlobalConfigurationError: If strict=True and configuration contains
256
+ disallowed content (e.g., Drogon data).
244
257
  """
245
258
  base_path = Path(base_path)
246
259
 
fmu/settings/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.5.0'
32
- __version_tuple__ = version_tuple = (0, 5, 0)
31
+ __version__ = version = '0.5.1'
32
+ __version_tuple__ = version_tuple = (0, 5, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-settings
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: A library for managing FMU settings
5
5
  Author-email: Equinor <fg-fmu_atlas@equinor.com>
6
6
  License: GPL-3.0
@@ -1,10 +1,10 @@
1
1
  fmu/__init__.py,sha256=htx6HlMme77I6pZ8U256-2B2cMJuELsu3JN3YM2Efh4,144
2
2
  fmu/settings/__init__.py,sha256=CkEE7al_uBCQO1lxBKN5LzyCwzzH5Aq6kkEIR7f-zTw,336
3
3
  fmu/settings/_fmu_dir.py,sha256=XeZjec78q0IUOpBq-VMkKoWtzXwBeQi2qWRIh_SIFwU,10859
4
- fmu/settings/_global_config.py,sha256=tYSQH_48cknaEeo8C_uraEaPXZrrN7cHYZOCX9G39yM,8916
4
+ fmu/settings/_global_config.py,sha256=C0_o99OhOc49ynz4h6ygbbHHH8OOI5lcVFr-9FCwD0c,9331
5
5
  fmu/settings/_init.py,sha256=ucueS0BlEsM3MkX7IaRISloH4vF7-_ZKSphrORbHgJ4,4381
6
6
  fmu/settings/_logging.py,sha256=nEdmZlNCBsB1GfDmFMKCjZmeuRp3CRlbz1EYUemc95Y,1104
7
- fmu/settings/_version.py,sha256=fvHpBU3KZKRinkriKdtAt3crenOyysELF-M9y3ozg3U,704
7
+ fmu/settings/_version.py,sha256=cYMOhuaBHd0MIZmumuccsEQ-AxM8LIJy9dsBAWgOpqE,704
8
8
  fmu/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  fmu/settings/types.py,sha256=aeXEsznBTT1YRRY_LSRqK1j2gmMmyLYYTGYl3a9fweU,513
10
10
  fmu/settings/_resources/__init__.py,sha256=LHYR_F7lNGdv8N6R3cEwds5CJQpkOthXFqsEs24vgF8,118
@@ -17,8 +17,8 @@ fmu/settings/models/_mappings.py,sha256=Z4Ex7MtmajBr6FjaNzmwDRwtJlaZZ8YKh9NDmZHR
17
17
  fmu/settings/models/lock_info.py,sha256=-oHDF9v9bDLCoFvEg4S6XXYLeo19zRAZ8HynCv75VWg,711
18
18
  fmu/settings/models/project_config.py,sha256=pxb54JmpXNMVAFUu_yJ89dNrYEk6hrPuFfFUpf84Jh0,1099
19
19
  fmu/settings/models/user_config.py,sha256=dWFTcZY6UnEgNTuGqB-izraJ657PecsW0e0Nt9GBDhI,2666
20
- fmu_settings-0.5.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
21
- fmu_settings-0.5.0.dist-info/METADATA,sha256=5Ff9Xfr_KsWUptwWt4HlKIkfnmME7D2UqclD-qzgrSo,2116
22
- fmu_settings-0.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- fmu_settings-0.5.0.dist-info/top_level.txt,sha256=Z-FIY3pxn0UK2Wxi9IJ7fKoLSraaxuNGi1eokiE0ShM,4
24
- fmu_settings-0.5.0.dist-info/RECORD,,
20
+ fmu_settings-0.5.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
21
+ fmu_settings-0.5.1.dist-info/METADATA,sha256=kVJutk6xJAJ2bHHn-VgKuhoIMtu761lgvC6G5LAr4kM,2116
22
+ fmu_settings-0.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ fmu_settings-0.5.1.dist-info/top_level.txt,sha256=Z-FIY3pxn0UK2Wxi9IJ7fKoLSraaxuNGi1eokiE0ShM,4
24
+ fmu_settings-0.5.1.dist-info/RECORD,,