Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
toargridding
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
toar-public
toargridding
Commits
5dec86cf
Commit
5dec86cf
authored
11 months ago
by
Carsten Hinz
Browse files
Options
Downloads
Patches
Plain Diff
added documentation
parent
ebe8ef24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Creation of first beta release version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
toargridding/static_metadata.py
+26
-1
26 additions, 1 deletion
toargridding/static_metadata.py
with
26 additions
and
1 deletion
toargridding/static_metadata.py
+
26
−
1
View file @
5dec86cf
...
...
@@ -8,14 +8,25 @@ GLOABAL_CF_ATTRIBUTES_PATH = STATIC_METADATA_PATH / "global_cf_attributes.json"
def
load_global_cf_attributes
():
"""
loading of global
Loads global metadata like details on the TOAD DB, license, and CF convention.
"""
with
open
(
GLOABAL_CF_ATTRIBUTES_PATH
,
"
r
"
)
as
f
:
return
json
.
load
(
f
)
@dataclass
class
TOARVariable
:
vars
=
None
"""
access to available variables of the TOAR database.
This class knows of all variables of the TOAR database supported by this module.
An instance allows direct access to the properties and metadata according to CF of this variable.
"""
vars
=
None
"""
available TOAR variables.
"""
name
:
str
longname
:
str
displayname
:
str
...
...
@@ -26,6 +37,10 @@ class TOARVariable:
@classmethod
def
load_toar_variables
(
cls
)
->
list
[
"
TOARVariable
"
]:
"""
load available variables
Is executed by loading the TOARVariable class
"""
with
open
(
TOAR_VARIABLES_METADATA_PATH
,
"
r
"
)
as
f
:
variables
=
json
.
load
(
f
)
...
...
@@ -33,6 +48,10 @@ class TOARVariable:
@classmethod
def
get
(
cls
,
standart_name
:
str
)
->
"
TOARVariable
"
:
"""
searches the known variables for the requested variable
return: provides direct access to the meta data of the selected variable
"""
for
var
in
cls
.
vars
:
if
var
.
standart_name
==
standart_name
:
return
var
...
...
@@ -41,14 +60,20 @@ class TOARVariable:
@property
def
toar_id
(
self
):
"""
get toar ID; same as id
"""
return
self
.
id
@property
def
standart_name
(
self
):
"""
alias to get cf_standardname
"""
return
self
.
cf_standardname
@property
def
long_name
(
self
):
"""
alias to get longname
"""
return
self
.
longname
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment