Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dccQuantities
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
DigitalDynamicMeasurement
dccQuantities
Commits
7bbe81bc
Commit
7bbe81bc
authored
1 year ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
fixed np.NaN-->np.nan and copy keyword as Bool
parent
be04586d
Branches
Branches containing commit
No related tags found
1 merge request
!3
Unify 'main' and 'devel'
Pipeline
#39923
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dccQuantities.py
+9
-9
9 additions, 9 deletions
src/dccQuantities.py
with
9 additions
and
9 deletions
src/dccQuantities.py
+
9
−
9
View file @
7bbe81bc
...
@@ -363,7 +363,7 @@ class dccQuantity:
...
@@ -363,7 +363,7 @@ class dccQuantity:
if
type
(
uncer
)
==
type
(
None
):
if
type
(
uncer
)
==
type
(
None
):
self
.
originalUncerType
=
None
self
.
originalUncerType
=
None
self
.
uncer
=
(
self
.
uncer
=
(
np
.
zeros_like
(
values
)
*
np
.
NaN
np
.
zeros_like
(
values
)
*
np
.
nan
)
)
else
:
else
:
# TODO better uncer handling with function dict
# TODO better uncer handling with function dict
...
@@ -790,13 +790,13 @@ class dccQuantity:
...
@@ -790,13 +790,13 @@ class dccQuantity:
if
self
.
originalUncerType
is
not
None
:
if
self
.
originalUncerType
is
not
None
:
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
else
:
else
:
return
(
self
.
values
[
item
],
np
.
NaN
)
return
(
self
.
values
[
item
],
np
.
nan
)
elif
type
(
item
)
==
slice
:
elif
type
(
item
)
==
slice
:
# TODO improve and check fancy slice indexing
# TODO improve and check fancy slice indexing
if
self
.
originalUncerType
is
not
None
:
if
self
.
originalUncerType
is
not
None
:
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
else
:
else
:
return
(
self
.
values
[
item
],
self
.
values
[
item
]
*
np
.
NaN
)
return
(
self
.
values
[
item
],
self
.
values
[
item
]
*
np
.
nan
)
elif
type
(
item
)
==
str
:
elif
type
(
item
)
==
str
:
if
item
!=
"
uncer
"
:
if
item
!=
"
uncer
"
:
try
:
try
:
...
@@ -821,7 +821,7 @@ class dccQuantity:
...
@@ -821,7 +821,7 @@ class dccQuantity:
if
self
.
originalUncerType
!=
None
:
if
self
.
originalUncerType
!=
None
:
return
self
.
uncer
return
self
.
uncer
else
:
else
:
return
np
.
zeros_like
(
self
.
values
)
*
np
.
NaN
return
np
.
zeros_like
(
self
.
values
)
*
np
.
nan
elif
type
(
item
)
==
tuple
:
elif
type
(
item
)
==
tuple
:
if
type
(
item
[
0
])
==
str
and
type
(
item
[
1
])
==
int
:
if
type
(
item
[
0
])
==
str
and
type
(
item
[
1
])
==
int
:
...
@@ -846,7 +846,7 @@ class dccQuantity:
...
@@ -846,7 +846,7 @@ class dccQuantity:
if
self
.
originalUncerType
!=
None
:
if
self
.
originalUncerType
!=
None
:
return
self
.
uncer
[
item
[
1
]]
return
self
.
uncer
[
item
[
1
]]
else
:
else
:
return
np
.
NaN
return
np
.
nan
elif
type
(
item
[
0
])
==
str
and
type
(
item
[
1
])
==
slice
:
elif
type
(
item
[
0
])
==
str
and
type
(
item
[
1
])
==
slice
:
if
not
item
[
0
]
==
"
uncer
"
:
if
not
item
[
0
]
==
"
uncer
"
:
try
:
try
:
...
@@ -869,7 +869,7 @@ class dccQuantity:
...
@@ -869,7 +869,7 @@ class dccQuantity:
if
self
.
originalUncerType
!=
None
:
if
self
.
originalUncerType
!=
None
:
return
self
.
uncer
[
item
[
1
]]
return
self
.
uncer
[
item
[
1
]]
else
:
else
:
return
np
.
zeros_like
(
self
.
values
)
*
np
.
NaN
[
item
[
1
]]
return
np
.
zeros_like
(
self
.
values
)
*
np
.
nan
[
item
[
1
]]
else
:
else
:
raise
KeyError
(
"
Second tuple element in neither int nor slice.
"
)
raise
KeyError
(
"
Second tuple element in neither int nor slice.
"
)
...
@@ -880,7 +880,7 @@ class dccQuantity:
...
@@ -880,7 +880,7 @@ class dccQuantity:
if
self
.
originalUncerType
is
not
None
:
if
self
.
originalUncerType
is
not
None
:
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
return
(
self
.
values
[
item
],
self
.
uncer
[
item
])
else
:
else
:
return
(
self
.
values
[
item
],
np
.
full
(
item
.
shape
,
np
.
NaN
))
return
(
self
.
values
[
item
],
np
.
full
(
item
.
shape
,
np
.
nan
))
else
:
else
:
raise
KeyError
(
raise
KeyError
(
str
(
item
)
str
(
item
)
...
@@ -1606,14 +1606,14 @@ class dccQuantityInterpolator:
...
@@ -1606,14 +1606,14 @@ class dccQuantityInterpolator:
indexVector
[
"
values
"
],
indexVector
[
"
values
"
],
dataVector
[
"
values
"
],
dataVector
[
"
values
"
],
kind
=
type
[
1
],
kind
=
type
[
1
],
copy
=
"
False
"
,
copy
=
False
,
bounds_error
=
True
,
bounds_error
=
True
,
),
),
"
uncer
"
:
sp
.
interpolate
.
interp1d
(
"
uncer
"
:
sp
.
interpolate
.
interp1d
(
indexVector
[
"
values
"
],
indexVector
[
"
values
"
],
dataVector
[
"
uncer
"
],
dataVector
[
"
uncer
"
],
kind
=
type
[
1
],
kind
=
type
[
1
],
copy
=
"
False
"
,
copy
=
False
,
bounds_error
=
True
,
bounds_error
=
True
,
),
),
}
}
...
...
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