Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoalopez committed May 21, 2024
1 parent 7b5e58f commit 270b329
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions grain_size_tools/new_piezometers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

8 changes: 7 additions & 1 deletion grain_size_tools/piezometric_database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
# Save this file in the same directory as GrainSizeTools #
# =================================================================== #


##### version #############################################################################
database:
- piezometer: None
version: 2024.05.21


###########################################################################################
# quartz piezometers
quartz:
Expand Down Expand Up @@ -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
###########################################################################################

0 comments on commit 270b329

Please sign in to comment.