From 270b329f08070ad65c05e7e5a722f527cbbe225f Mon Sep 17 00:00:00 2001 From: "Marco A. Lopez-Sanchez" Date: Tue, 21 May 2024 17:57:06 +0200 Subject: [PATCH] minor tweaks --- grain_size_tools/new_piezometers.py | 10 ++++++++-- grain_size_tools/piezometric_database.yaml | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/grain_size_tools/new_piezometers.py b/grain_size_tools/new_piezometers.py index 7224e54..4f46c58 100644 --- a/grain_size_tools/new_piezometers.py +++ b/grain_size_tools/new_piezometers.py @@ -54,6 +54,9 @@ def load_piezometers_from_yaml(filepath): with open(filepath, "r") as file: data = yaml.safe_load(file) + # get database version + version = data["database"][0]["version"] + for mineral, piezos in data.items(): for piezo_data in piezos: name = piezo_data.pop("piezometer") @@ -77,8 +80,11 @@ def load_piezometers_from_yaml(filepath): piezo = feldspar(name=name, **piezo_data) feldspar.piezometers[name] = piezo setattr(feldspar, name, piezo) + + return version if __name__ == "__main__": - load_piezometers_from_yaml("piezometric_database.yaml") - print("database v2024.05.21 loaded") + version = load_piezometers_from_yaml("piezometric_database.yaml") + print(f"piezometric database v{version} loaded") + diff --git a/grain_size_tools/piezometric_database.yaml b/grain_size_tools/piezometric_database.yaml index fd6a0d6..360e7ba 100644 --- a/grain_size_tools/piezometric_database.yaml +++ b/grain_size_tools/piezometric_database.yaml @@ -51,6 +51,13 @@ # Save this file in the same directory as GrainSizeTools # # =================================================================== # + +##### version ############################################################################# +database: + - piezometer: None + version: 2024.05.21 + + ########################################################################################### # quartz piezometers quartz: @@ -242,6 +249,5 @@ feldspar: The Post and Tullis (1999) piezometer was calibrated using the median of the equivalent circular diameters (ECD) grain size with no stereological correction. - # End of file ########################################################################################### \ No newline at end of file