Skip to content

Fix lifetime of TimeSeries in python pyndings #1343

@MaxBetzDLR

Description

@MaxBetzDLR

Bug description

A TimeSeries in the memilio-simulation package can be converted into a numpy array. This array is invalid as soon as the referenced Timeseries is invalid. This leads to undefined bahaviour when returning the numpy array from a function.

Version

Any

To reproduce

Steps to reproduce the bug:

  1. Create a TimeSeries inside a function, i.e. as result from simulate
  2. Create numpy array reference with .as_ndarray()
  3. return numpy array from function
  4. Leaving scope deletes referenced data and thus numpy array is invalid

Relevant log output

Add any relevant information, e.g. used compiler, screenshots.

Checklist

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Metadata

Metadata

Assignees

Labels

class::bugBugs found in the softwareloc::data handlingThis issue concerns any kind of data handling.loc::python interfaceThis issue concerns the python interface to the backend implementation.

Type

No type

Projects

Status

Done (Total)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions