conventions
¶
Naming conventions for the EFTS netCDF file format.
TYPES_CONVERTIBLE_TO_TIMESTAMP
module-attribute
¶
Definition of a 'type' for type hints.
check_hydrologic_variables
¶
Checks if the variable names and attributes in a netCDF file comply with the STF convention.
Parameters:
-
file_path
(str
) –The path to the netCDF file.
Returns:
-
Dict[str, List[str]]
–Dict[str, List[str]]: A dictionary with keys "INFO", "WARNING", "ERROR" and values as lists of strings describing compliance issues.
Source code in src/efts_io/conventions.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 |
|
check_index_found
¶
Helper function to check that a value (index) was is indeed found in the dimension.
Source code in src/efts_io/conventions.py
178 179 180 181 182 183 184 185 186 187 188 |
|
check_optional_variable_attributes
¶
check_optional_variable_attributes(
variable: Any,
error_threshold: AttributesErrorLevel = AttributesErrorLevel.NONE,
) -> List[str]
Checks if the attributes of the observed variable comply with the conventions.
Source code in src/efts_io/conventions.py
601 602 603 604 605 606 607 608 609 610 611 612 |
|
check_stf_compliance
¶
Checks the compliance of a netCDF file with the STF convention.
Parameters:
-
file_path
(str
) –The path to the netCDF file.
Returns:
-
Dict[str, List[str]]
–Dict[str, List[str]]: A dictionary with keys "INFO", "WARNING", "ERROR" and values as lists of strings describing compliance issues.
Source code in src/efts_io/conventions.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
convert_to_datetime64_utc
¶
convert_to_datetime64_utc(
x: ConvertibleToTimestamp,
) -> datetime64
Converts a known timestamp representation an np.datetime64.
Source code in src/efts_io/conventions.py
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
|
exportable_to_stf2
¶
exportable_to_stf2(data: MdDatasetsType) -> bool
Check if the dataset can be written to a netCDF file compliant with STF 2.0 specification.
This method checks if the underlying xarray dataset or dataarray has the required dimensions and global attributes as specified by the STF 2.0 convention.
Returns:
-
bool
(bool
) –True if the dataset can be written to a STF 2.0 compliant netCDF file, False otherwise.
Source code in src/efts_io/conventions.py
634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 |
|
get_default_dim_order
¶
Default order of dimensions in the netCDF file.
Returns:
Source code in src/efts_io/conventions.py
164 165 166 167 168 169 170 171 172 173 174 175 |
|
has_required_global_attributes
¶
has_required_global_attributes(d: MdDatasetsType) -> bool
has_required_global_attributes.
Source code in src/efts_io/conventions.py
275 276 277 278 279 280 281 282 283 |
|
has_required_stf2_dimensions
¶
has_required_stf2_dimensions(
d: MdDatasetsType,
mandatory_dimensions: Optional[Iterable[str]] = None,
) -> bool
Has the dataset the required dimensions for STF conventions.
Parameters:
-
d
(MdDatasetsType
) –data object to check
Returns:
-
bool
(bool
) –Has it the minimum STF dimentions
Source code in src/efts_io/conventions.py
246 247 248 249 250 251 252 253 254 255 256 |
|
has_required_variables_xr
¶
has_required_variables_xr(d: MdDatasetsType) -> bool
has_required_variables.
Source code in src/efts_io/conventions.py
293 294 295 296 297 298 299 300 |
|
has_required_xarray_dimensions
¶
has_required_xarray_dimensions(d: MdDatasetsType) -> bool
Has the dataset the required dimensions for an in memory xarray representation.
Source code in src/efts_io/conventions.py
259 260 261 |
|
has_required_xarray_global_attributes
¶
has_required_xarray_global_attributes(
d: MdDatasetsType,
) -> bool
has_required_xarray_global_attributes.
Source code in src/efts_io/conventions.py
286 287 288 289 290 |
|
has_variable
¶
has_variable.
Source code in src/efts_io/conventions.py
303 304 305 306 307 |
|
is_subset_required_xarray_dimensions
¶
is_subset_required_xarray_dimensions(
d: MdDatasetsType,
) -> bool
Has the data array or dataset dimensions that are a subset of the spedified dims?
Source code in src/efts_io/conventions.py
264 265 266 |
|