Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier access to timepoints via ExpDataView #2193

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 15, 2023

ExpDataView provides convenient access to measurements and the like as numpy arrays. However, accessing the associated timepoints is currently only possible via ExpDataView(...)._swigptr.ts_ which returns an amici.amici.DoubleVector. That's awkward.

Now:

amici.ExpDataView(amici.ExpData(1, 2, 3, [4, 5, 6])).ts
Out[3]: array([4., 5., 6.])

Resolves #2191

ExpDataView provides convenient access to measurements and the like as numpy
arrays. However, accessing the associated timepoints is currently only
possible via `ExpDataView(...)._swigptr.ts_` which returns an
amici.amici.DoubleVector. That's awkward.

Now:

```python
amici.ExpDataView(amici.ExpData(1, 2, 3, [4, 5, 6])).ts
Out[3]: array([4., 5., 6.])
```

Resolves #2191
@dweindl dweindl requested a review from a team as a code owner November 15, 2023 09:17
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #2193 (d48986b) into develop (269910b) will decrease coverage by 0.84%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2193      +/-   ##
===========================================
- Coverage    77.45%   76.62%   -0.84%     
===========================================
  Files           82       82              
  Lines        15004    15005       +1     
===========================================
- Hits         11621    11497     -124     
- Misses        3383     3508     +125     
Flag Coverage Δ
cpp 73.54% <ø> (+0.01%) ⬆️
petab 53.83% <0.00%> (-0.01%) ⬇️
python 77.17% <100.00%> (-2.28%) ⬇️
sbmlsuite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
python/sdist/amici/numpy.py 83.00% <100.00%> (+0.17%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was edata.getTimepoints(), but I agree this is more convenient.

@dweindl dweindl merged commit 316d94d into develop Nov 15, 2023
17 of 19 checks passed
@dweindl dweindl deleted the edataview_timepoints branch November 15, 2023 11:37
dweindl added a commit that referenced this pull request Nov 15, 2023
ExpDataView provides convenient access to measurements and the like as numpy
arrays. However, accessing the associated timepoints is currently only
possible via `ExpDataView(...)._swigptr.ts_` which returns an
amici.amici.DoubleVector. That's awkward.

Now:

```python
amici.ExpDataView(amici.ExpData(1, 2, 3, [4, 5, 6])).ts
Out[3]: array([4., 5., 6.])
```

Resolves #2191
@dweindl dweindl linked an issue Nov 20, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easier access to timepoints via ExpDataView
2 participants