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
24e44700
Commit
24e44700
authored
1 year ago
by
Sebastian Müller
🐈
Browse files
Options
Downloads
Patches
Plain Diff
remove compress convenience routines again to keep the API clean
parent
73c460bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!258
Grid mask support
Pipeline
#186357
passed with stages
Stage: test
Stage: build
Stage: docs
in 5 minutes and 7 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/finam/__init__.py
+0
-4
0 additions, 4 deletions
src/finam/__init__.py
src/finam/tools/__init__.py
+0
-11
0 additions, 11 deletions
src/finam/tools/__init__.py
src/finam/tools/io_helper.py
+0
-58
0 additions, 58 deletions
src/finam/tools/io_helper.py
with
0 additions
and
73 deletions
src/finam/__init__.py
+
0
−
4
View file @
24e44700
...
...
@@ -80,8 +80,6 @@ Utilities for data and metadata handling.
Info
UNITS
pull_compressed
push_compressed
Interfaces
==========
...
...
@@ -182,7 +180,6 @@ from .sdk import (
TimeComponent
,
TimeDelayAdapter
,
)
from
.tools
import
pull_compressed
,
push_compressed
try
:
from
._version
import
__version__
...
...
@@ -229,7 +226,6 @@ __all__ += [
]
__all__
+=
[
"
CellType
"
,
"
Location
"
]
__all__
+=
[
"
UNITS
"
,
"
Info
"
]
__all__
+=
[
"
pull_compressed
"
,
"
push_compressed
"
]
__all__
+=
[
"
FinamCircularCouplingError
"
,
"
FinamConnectError
"
,
...
...
This diff is collapsed.
Click to expand it.
src/finam/tools/__init__.py
+
0
−
11
View file @
24e44700
...
...
@@ -57,22 +57,12 @@ Connect helper
FromInput
FromOutput
FromValue
IO helper
=========
.. autosummary::
:toctree: generated
pull_compressed
push_compressed
"""
from
.connect_helper
import
ConnectHelper
,
FromInput
,
FromOutput
,
FromValue
from
.cwd_helper
import
execute_in_cwd
,
set_directory
from
.date_helper
import
is_timedelta
from
.enum_helper
import
get_enum_value
from
.inspect_helper
import
inspect
from
.io_helper
import
pull_compressed
,
push_compressed
from
.log_helper
import
(
ErrorLogger
,
LogCStdOutStdErr
,
...
...
@@ -95,4 +85,3 @@ __all__ += [
"
LogCStdOutStdErr
"
,
]
__all__
+=
[
"
ConnectHelper
"
,
"
FromInput
"
,
"
FromOutput
"
,
"
FromValue
"
]
__all__
+=
[
"
pull_compressed
"
,
"
push_compressed
"
]
This diff is collapsed.
Click to expand it.
src/finam/tools/io_helper.py
deleted
100644 → 0
+
0
−
58
View file @
73c460bb
"""
Input and Output helpers.
"""
import
numpy
as
np
from
..interfaces
import
IInput
,
IOutput
def
pull_compressed
(
io
,
time
):
"""
Pull compressed data from an Input object.
Parameters
----------
io : IInput
The Input object to pull data from.
time : :class:`datetime <datetime.datetime>`
Simulation time to get the data for.
Returns
-------
:class:`pint.Quantity`
Flattened and unmasked data values for the given simulation time.
Raises
------
ValueError
If io is not an IInput instance.
"""
if
not
isinstance
(
io
,
IInput
):
msg
=
"
pull_compressed: Given io-object is not an IInput instance.
"
raise
ValueError
(
msg
)
return
io
.
info
.
grid
.
to_compressed
(
io
.
pull_data
(
time
))
def
push_compressed
(
io
,
time
,
data
,
nodata
=
np
.
nan
):
"""
Push compressed data to an Output object.
Parameters
----------
io : IOutput
The Output object to push data to.
time : :class:`datetime <datetime.datetime>`
Simulation time of the data set.
data : array_like
Flattened and unmasked data values to push.
nodata : numeric, optional
Fill value for masked values. Should have a compatible type.
By default np.nan
Raises
------
ValueError
If io is not an IOutput instance.
"""
if
not
isinstance
(
io
,
IOutput
):
msg
=
"
push_compressed: Given io-object is not an IOutput instance.
"
raise
ValueError
(
msg
)
io
.
push_data
(
io
.
info
.
grid
.
from_compressed
(
data
,
nodata
),
time
)
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