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

DOC: Documentation for Function Class Usage #465

Merged
merged 14 commits into from
Nov 18, 2023
Merged

Conversation

phmbressan
Copy link
Collaborator

@phmbressan phmbressan commented Nov 17, 2023

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates
  • Other (please describe):

What is New

This PR introduces Function class documentation page. A function.rst file was created containing:

  • A brief introduction the the Function class functionalities;
  • A section exploring the possible Function data sources;
  • A brief exposition on how the different constructor parameters change the Function results (e.g. interpolation);
  • Examples of some useful features of the class (value interpolation, arithmetic, discretization and calculus).

Breaking change

  • Yes
  • No

Additional information

Notice that this PR includes the branch of #451 since it contains a necessary fix to 2D plots.

@phmbressan phmbressan added the Docs Docs and examples related label Nov 17, 2023
@phmbressan phmbressan added this to the Release v1.X.0 milestone Nov 17, 2023
@phmbressan phmbressan self-assigned this Nov 17, 2023
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a64c0ef) 70.87% compared to head (277a120) 70.85%.
Report is 1 commits behind head on develop.

Files Patch % Lines
rocketpy/mathutils/function.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #465      +/-   ##
===========================================
- Coverage    70.87%   70.85%   -0.02%     
===========================================
  Files           55       55              
  Lines         9223     9227       +4     
===========================================
+ Hits          6537     6538       +1     
- Misses        2686     2689       +3     
Flag Coverage Δ
unittests 70.85% <60.00%> (-0.02%) ⬇️

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

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

Copy link
Member

@MateusStano MateusStano left a comment

Choose a reason for hiding this comment

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

The other Function functionalities would be great to be documented here:

  • find_input
  • average
  • compose
  • inverse_function
  • PiecewiseFunction class

None of them are essential but something we should definitely add later

docs/user/function.rst Outdated Show resolved Hide resolved
Comment on lines 220 to 221
.. note::
Compare the interpolation and extrapolation effects by changing their methods. Check out this plot results with ``linear`` interpolation and ``constant`` extrapolation and see their difference.
Copy link
Member

Choose a reason for hiding this comment

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

The documentation would feel more complete if you showed the diference of the interpolations here. At least of the linear case

Comment on lines 247 to 252
Furthermore, the :meth:`rocketpy.Function.get_value` method can be used to get a list of outputs from a list of inputs:

.. jupyter-execute::

print(f.get_value([1, 4, 9, 16, 25]))

Copy link
Member

Choose a reason for hiding this comment

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

This can be done with the call method too I believe. This is not clear here

Comment on lines +253 to +254
b. Function Arithmetic
~~~~~~~~~~~~~~~~~~~~~~
Copy link
Member

Choose a reason for hiding this comment

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

This is missing mentioning all the arthmetic operations that can be done. A simple listing would be fine


d. Differentiation and Integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Member

Choose a reason for hiding this comment

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

Does everything here work with 2D or higher dimension Functions?
Same question for the Discretization section

@MateusStano
Copy link
Member

Also, please add mentions of this page in other pages of the docs. Mentioning Function usage in the Export Data section of the First simulation Page is a must

@MateusStano MateusStano merged commit 0c28f2a into develop Nov 18, 2023
11 of 13 checks passed
@Gui-FernandesBR Gui-FernandesBR deleted the doc/function-guide branch November 18, 2023 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Docs and examples related
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants