diff --git a/coloc_sat/__init__.py b/coloc_sat/__init__.py index 17fe777..a71a1df 100644 --- a/coloc_sat/__init__.py +++ b/coloc_sat/__init__.py @@ -2,10 +2,10 @@ __author__ = """Yann Reynaud""" __email__ = 'yann.reynaud.2@ifremer.fr' -__version__ = '0.1.0' __all__ = ['GetSarMeta', 'GetEra5Meta', 'GetHy2Meta', 'GetSmosMeta', 'GetWindSatMeta', 'GetSmapMeta', 'ProductIntersection', 'GenerateColoc'] +from .version import __version__ from .sar_meta import GetSarMeta from .era5_meta import GetEra5Meta from .hy2_meta import GetHy2Meta diff --git a/coloc_sat/config_version.json b/coloc_sat/config_version.json deleted file mode 100644 index 1587a66..0000000 --- a/coloc_sat/config_version.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "1.0.0" -} diff --git a/coloc_sat/intersection.py b/coloc_sat/intersection.py index 87128b0..64d3a0f 100644 --- a/coloc_sat/intersection.py +++ b/coloc_sat/intersection.py @@ -12,6 +12,8 @@ from .intersection_tools import extract_times_dataset, are_dimensions_empty, get_footprint_from_ll_ds, \ get_polygon_area_in_km_squared, get_transform, get_common_points, get_nearest_time_datasets, remove_nat from .tools import mean_time_diff, reformat_meta, convert_str_to_polygon +from .version import __version__ + logger = logging.getLogger(__name__) @@ -747,9 +749,7 @@ def get_common_attrs(): attrs['polygon_common_zone'] = poly_common_zone() attrs['area_intersection'] = str(get_polygon_area_in_km_squared(attrs['polygon_common_zone'])) # add tool version to attributes - with open(Path(__file__).resolve().parent / "config_version.json", "r") as config_file: - config_data = json.load(config_file) - attrs['version'] = config_data["version"] + attrs['coloc_sat_version'] = __version__ return attrs merged_ds = xr.merge([dataset1, dataset2], compat='override')