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
e4ac79c9
Commit
e4ac79c9
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
convert units in to_units only if required - units noop 400ms -> 16ms
parent
4feb52c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!222
Xarray optimizations
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/finam/data/tools.py
+4
-1
4 additions, 1 deletion
src/finam/data/tools.py
with
4 additions
and
1 deletion
src/finam/data/tools.py
+
4
−
1
View file @
e4ac79c9
...
...
@@ -407,7 +407,10 @@ def to_units(xdata, units):
Converted data.
"""
check_quantified
(
xdata
,
"
to_units
"
)
return
xdata
.
pint
.
to
(
pint
.
Unit
(
units
))
units
=
UNITS
.
Unit
(
units
)
if
units
==
xdata
.
pint
.
units
:
return
xdata
return
xdata
.
pint
.
to
(
units
)
def
full_like
(
xdata
,
value
):
...
...
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