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

Integrate FDataIrregular using scipy.integrate.simpson on each curve separately #608

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

pcuestas
Copy link
Contributor

@pcuestas pcuestas commented Apr 1, 2024

Describe the proposed changes

Integration for irregular curves has been implemented using scipy.integrate.simpson to integrate irregular curves (of 1-dimensional domain) one by one.

Additional information

We have not agreed on how integration of irregular data with higher dimensional domains should be defined, so it is not to be implemented yet.

This is a first implementation which may or may not be later improved by manually computing simpson's coefficients, multiply them against the curves' values and calling skfda.representation.irregular._reduceat to add the results.

@pcuestas pcuestas requested a review from vnmabus April 1, 2024 15:22
@@ -23,6 +22,7 @@
import numpy as np
import pandas.api.extensions
from matplotlib.figure import Figure
import scipy
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
I001 isort found an import in the wrong position

raise NotImplementedError()
if self.dim_domain != 1:
raise NotImplementedError(
"Integration only implemented for 1D domains."
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
C812 missing trailing comma

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.65%. Comparing base (1ddad0e) to head (56f1512).

Files Patch % Lines
skfda/representation/irregular.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #608   +/-   ##
========================================
  Coverage    86.65%   86.65%           
========================================
  Files          156      156           
  Lines        13314    13322    +8     
========================================
+ Hits         11537    11544    +7     
- Misses        1777     1778    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@vnmabus vnmabus left a comment

Choose a reason for hiding this comment

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

LGTM.

@vnmabus vnmabus merged commit 73161f7 into develop Apr 4, 2024
21 of 23 checks passed
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.

2 participants