diff --git a/.gitignore b/.gitignore index 080382510bd120367b134f02a3f2cc9fecdd0883..22a85bd433f47de23091003d8742efa61f3043e3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ data/ tests/results tests/temp_data_cache/ notTracked/ +*.swp diff --git a/toargridding/metadata.py b/toargridding/metadata.py index 627f1167ceca07b351c8f12058c3c52a5c817755..6085adf35c50101b05eb0d2ed415d18bb02960d6 100644 --- a/toargridding/metadata.py +++ b/toargridding/metadata.py @@ -10,6 +10,8 @@ from toargridding.static_metadata import global_cf_attributes, TOARVariable from typing import Dict +import importlib.metadata + date_created = datetime.utcnow().strftime("%Y-%m-dT%H:%M:%SZ") #date_created = datetime.now(datetime.UTC).strftime("%Y-%m-dT%H:%M:%SZ") # fix as utcnow will be removed in the future @@ -204,6 +206,7 @@ def get_global_attributes(metadata: Metadata) -> Dict: "time_coverage_end": metadata.time.end.isoformat(), # "time_coverage_duration": 0, # TODO insert durations # "time_coverage_resolution": 0, + "product_version": f"version of toargridding {importlib.metadata.version( __package__ or __name__ )}", } for key, value in metadata.moreOptions.items(): if not key in dynamic_cf_attributes: diff --git a/toargridding/static_metadata/global_cf_attributes.json b/toargridding/static_metadata/global_cf_attributes.json index c6a177cc37958a4fab3ec8300dc24c982251f70b..bab7e034ef99a335e56a03dd391ff8e4d94dc869 100644 --- a/toargridding/static_metadata/global_cf_attributes.json +++ b/toargridding/static_metadata/global_cf_attributes.json @@ -18,7 +18,6 @@ "creator_type": "institution", "creator_institution": "The Tropospheric Ozone Assessment Report (TOAR) Data Centre, Research Centre Jülich, Jülich, Germany", "publisher_type": "institution", - "product_version": "version of toargridding ?", "references": "https://toar-data.fz-juelich.de/", "license": "CC-BY 4", "acknowledgment": "This project was funded by the EU’s ERC programme, Grant Agreement 78576. This work is part of the Tropospheric Ozone Assessment Report (TOAR) which was supported by the International Global Atmospheric Chemistry (IGAC) project, the National Oceanic and Atmospheric Administration (NOAA), Forschungszentrum Jülich, and the World Meteorological Organisation (WMO). Many institutions and agencies supported the implementation of the measurements, and the processing, quality assurance, and submission of the data contained in the TOAR database"