From a0c1f1d1f358da95daf5143ea0de7a826703307a Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Mon, 30 Dec 2024 17:43:46 +0100 Subject: [PATCH] Update public fields --- Project.toml | 2 +- src/PseudoPotentialData.jl | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 2fcf57f..38ee8a0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PseudoPotentialData" uuid = "5751a51d-ac76-4487-a056-413ecf6fbe19" authors = ["Michael F. Herbst and contributors"] -version = "0.2.1" +version = "0.2.2" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" diff --git a/src/PseudoPotentialData.jl b/src/PseudoPotentialData.jl index dba8c0a..33bb6f1 100644 --- a/src/PseudoPotentialData.jl +++ b/src/PseudoPotentialData.jl @@ -19,13 +19,18 @@ export pseudofile, pseudometa, recommended_cutoff include("pseudofamily.jl") """Get the list of available pseudopotential family identifiers.""" -function family_identifiers() +family_identifiers() = sort(collect(keys(families))) + +""" +Dictionary from pseudopotential identifiers to respective `PseudoLibrary` instances. +Note, that in the REPL typing `PseudoPotentialData.families["dojo. ` allows +to find the pseudofamily identifier by Tab completion. +""" +const families = let artifact_file = find_artifacts_toml(@__FILE__) @assert !isnothing(artifact_file) - sort(collect(keys(TOML.parsefile(artifact_file)))) + Dict(id => PseudoFamily(id) + for id in keys(TOML.parsefile(artifact_file))) end -"""The list of all known pseudopotential families.""" -const families = map(PseudoFamily, family_identifiers()) - end