Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FINAM
finam
Commits
0c0f7e4a
Commit
0c0f7e4a
authored
1 year ago
by
Sebastian Müller
🐈
Browse files
Options
Downloads
Patches
Plain Diff
Info: add 'is_masked' property
parent
b62a1a08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!260
Masked array support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/finam/data/tools.py
+7
-0
7 additions, 0 deletions
src/finam/data/tools.py
with
7 additions
and
0 deletions
src/finam/data/tools.py
+
7
−
0
View file @
0c0f7e4a
...
...
@@ -20,6 +20,8 @@ UNITS = pint.application_registry
_UNIT_PAIRS_CACHE
=
{}
_MASK_INDICATORS
=
[
"
_FillValue
"
,
"
missing_value
"
]
def
prepare
(
data
,
info
,
time_entries
=
1
,
force_copy
=
False
,
report_conversion
=
False
):
"""
...
...
@@ -667,6 +669,11 @@ class Info:
units
=
None
if
units
is
None
else
UNITS
.
Unit
(
units
)
self
.
meta
[
"
units
"
]
=
units
@property
def
is_masked
(
self
):
"""
bool: whether info indicates masked data (
"
_FillValue
"
or
"
missing_value
"
in meta).
"""
return
any
(
v
in
self
.
meta
for
v
in
_MASK_INDICATORS
)
def
copy
(
self
):
"""
Copies the info object
"""
return
copy
.
copy
(
self
)
...
...
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