Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ICARTT Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
MBEES
ICARTT Python Package
Merge requests
!22
towards release
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
towards release
FObersteiner/icartt-dev:dev
into
master
Overview
0
Commits
14
Pipelines
2
Changes
1
Merged
Florian Obersteiner
requested to merge
FObersteiner/icartt-dev:dev
into
master
3 years ago
Overview
0
Commits
14
Pipelines
2
Changes
1
Expand
some suggestions, addressing
#23 (closed)
and
#9
0
0
Merge request reports
Viewing commit
26c10427
Prev
Next
Show latest version
1 file
+
9
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
26c10427
cosmetics
· 26c10427
Florian Obersteiner
authored
3 years ago
src/icartt/dataset.py
+
9
−
4
Options
@@ -352,9 +352,9 @@ class Variable:
# The first character must be a letter,
firstIsAlpha
=
bool
(
re
.
match
(
"
[a-zA-Z]
"
,
name
[
0
]))
# and the name can be at most 31 characters in length.
le
ssThan
31Chars
=
len
(
name
)
<=
31
le31Chars
=
len
(
name
)
<=
31
return
allAreAlphaOrUnderscore
and
firstIsAlpha
and
le
ssThan
31Chars
return
allAreAlphaOrUnderscore
and
firstIsAlpha
and
le31Chars
def
__init__
(
self
,
@@ -401,6 +401,9 @@ class Variable:
self
.
scale
=
scale
self
.
miss
=
miss
def
__repr__
(
self
):
return
f
"
[
{
self
.
units
}
],
{
self
.
vartype
.
name
}
"
def
__str__
(
self
):
return
self
.
desc
()
@@ -448,7 +451,7 @@ class Dataset:
if
self
.
defineMode
:
return
np
.
datetime64
(
"
NaT
"
)
# for 1001
,
its an array, for 2110 a dict
# for 1001 it
'
s an array, for 2110 a dict
if
not
isinstance
(
self
.
data
.
data
,
(
np
.
ndarray
,
dict
)):
return
np
.
datetime64
(
"
NaT
"
)
@@ -1011,8 +1014,10 @@ class Dataset:
if
not
self
.
isValidFileName
(
pathlib
.
Path
(
f
).
name
):
warnings
.
warn
(
f
"
{
pathlib
.
Path
(
f
).
name
}
is not a valid ICARTT filename
"
)
else
:
# try to obtain dataID and locationID from file name
else
:
# try to obtain dataID and locationID from file name
parts
=
pathlib
.
Path
(
f
).
name
.
split
(
"
_
"
)
# there should be at least 3 parts; data ID, location ID and revision date + file name extension
if
len
(
parts
)
>
2
:
self
.
dataID
=
parts
[
0
]
self
.
locationID
=
parts
[
1
]
Loading