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
2bb3415a
Commit
2bb3415a
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
check for shared memory in subsequent CallbackOutput data
parent
280b828b
No related branches found
No related tags found
1 merge request
!217
Ensure data is a copy in outputs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/finam/sdk/output.py
+10
-1
10 additions, 1 deletion
src/finam/sdk/output.py
with
10 additions
and
1 deletion
src/finam/sdk/output.py
+
10
−
1
View file @
2bb3415a
...
...
@@ -393,6 +393,7 @@ class CallbackOutput(Output):
def
__init__
(
self
,
callback
,
name
,
info
=
None
,
**
info_kwargs
):
super
().
__init__
(
name
=
name
,
info
=
info
,
static
=
False
,
**
info_kwargs
)
self
.
callback
=
callback
self
.
last_data
=
None
@property
def
needs_push
(
self
):
...
...
@@ -443,7 +444,15 @@ class CallbackOutput(Output):
raise
FinamNoDataError
(
f
"
No data available in
{
self
.
name
}
"
)
with
ErrorLogger
(
self
.
logger
):
return
tools
.
to_xarray
(
data
,
self
.
name
,
self
.
info
,
time
)
xdata
=
tools
.
to_xarray
(
data
,
self
.
name
,
self
.
info
,
time
)
if
self
.
last_data
is
not
None
and
np
.
may_share_memory
(
tools
.
get_magnitude
(
self
.
last_data
),
tools
.
get_magnitude
(
xdata
)
):
raise
FinamDataError
(
"
Received data that shares memory with previously received data.
"
)
self
.
last_data
=
xdata
return
xdata
def
_check_time
(
time
,
is_static
):
...
...
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