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

GIT: Updates master to v1.7.0 #731

Merged
merged 38 commits into from
Nov 30, 2024
Merged

GIT: Updates master to v1.7.0 #731

merged 38 commits into from
Nov 30, 2024

Conversation

Gui-FernandesBR
Copy link
Member

Quick and easy approval

Morgan Thomas and others added 16 commits October 8, 2024 23:53
* ENH: Add filename option to most plot functions

* MNT: Use f-strings in plot_helpers.py

Co-authored-by: Gui-FernandesBR <[email protected]>

* MNT: Run isort

* DOC: Make docstring fit into 80 columns and reference matplotlib formats

* MNT: Run black

* MNT: Move get_matplotlib_supported_file_endings into tools

* Apply suggestions from code review

Co-authored-by: Lucas Prates <[email protected]>

* Fix function/__call__ check

* Change plot_helpers warnings from UserWarning to ValueError

* Update docstrings

* Fix issues from rebase

* MNT: post merge fixes regarding plots.

* MNT: post merge fixes and linting.

* TST: implement testing of show or save plots.

* MNT: Correct CHANGELOG file.

* MNT: Improve error handling of unsupported file endings.

* DOC: add doc section for plot saving.

---------

Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Lucas Prates <[email protected]>
Co-authored-by: Pedro Bressan <[email protected]>
DOC: fixed documentation about spherical caps
…ctions

BUG: Sideslip Angle and Damping Coefficient Calculation
@Gui-FernandesBR Gui-FernandesBR self-assigned this Nov 15, 2024
@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner November 15, 2024 22:16
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 76.74419% with 50 lines in your changes missing coverage. Please review.

Project coverage is 75.97%. Comparing base (a1709f9) to head (9761e74).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
rocketpy/simulation/monte_carlo.py 37.03% 17 Missing ⚠️
rocketpy/plots/environment_analysis_plots.py 42.85% 16 Missing ⚠️
rocketpy/mathutils/function.py 75.00% 2 Missing ⚠️
rocketpy/plots/plot_helpers.py 91.66% 2 Missing ⚠️
rocketpy/prints/monte_carlo_prints.py 50.00% 2 Missing ⚠️
rocketpy/motors/hybrid_motor.py 50.00% 1 Missing ⚠️
rocketpy/motors/liquid_motor.py 50.00% 1 Missing ⚠️
rocketpy/motors/solid_motor.py 50.00% 1 Missing ⚠️
rocketpy/motors/tank.py 50.00% 1 Missing ⚠️
rocketpy/plots/aero_surface_plots.py 93.33% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #731   +/-   ##
=======================================
  Coverage   75.97%   75.97%           
=======================================
  Files          95       95           
  Lines       11027    11027           
=======================================
  Hits         8378     8378           
  Misses       2649     2649           

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

phmbressan
phmbressan previously approved these changes Nov 15, 2024
@Gui-FernandesBR
Copy link
Member Author

@phmbressan I was reflecting on the filename addition and got to a question. I'd like to ask your opinion on that.

If we release this version as it is, in the future we may suffer when adding new arguments to methods that has the filename argument. What will happen is that the filename will no longer be the last argument if we add new arguments to these methods.

I wonder if this is the case where we would benefit from doing something like this:

def thios_method(self, arg1, arg2, *, filename=None):

That way we could (potentially) add new arguments before the filename, this enforcing the filename always to be the last argument present in a method.

@Gui-FernandesBR
Copy link
Member Author

image

@phmbressan
Copy link
Collaborator

If we release this version as it is, in the future we may suffer when adding new arguments to methods that has the filename argument. What will happen is that the filename will no longer be the last argument if we add new arguments to these methods.

I wonder if this is the case where we would benefit from doing something like this:

def thios_method(self, arg1, arg2, *, filename=None):

That way we could (potentially) add new arguments before the filename, this enforcing the filename always to be the last argument present in a method.

Well noticed. This seems like a good example of a future situation that we might get stuck with a breaking change. The solution you provided is alright, although in this case I find more straightforward to put it in the **kwargs. In both cases, I believe using it positionally only would cause an error.

def this_method(self, arg1, arg2, **kwargs):

I believe we should change the current behavior to one of the two solutions. Do you have any preferences?

@Gui-FernandesBR
Copy link
Member Author

@phmbressan just to be clear... we would be removing the filename argument to **kwargs ?

@phmbressan
Copy link
Collaborator

just to be clear... we would be removing the filename argument to **kwargs ?

That is one possibility. It makes more sense if we had many paramters, like matplotlib does here (scroll down to the kwargs section):
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html

The way you solved it should also work, if you prefer. The difference between them is that kwargs would allow any names to be a "named parameter".

@Gui-FernandesBR
Copy link
Member Author

just to be clear... we would be removing the filename argument to **kwargs ?

That is one possibility. It makes more sense if we had many parameters, like matplotlib does here (scroll down to the kwargs section): https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html

The way you solved it should also work, if you prefer. The difference between them is that kwargs would allow any names to be a "named parameter".

@phmbressan I reflected on both options, they both are pretty similar to be honest. The idea is to enforce that no one ever uses the filename as a positional argument.

The only advantage I see in using the * operator is for type hinting purposes, since it would allow us to specify the type of the inputs. I know we do not use type hints in this project yet, but I have a dream one day someone will convince @MateusStano of using that!

Aside that fact, I see no other reason for any preference here.
What do you think? Do you agree?

I believe we should make a new PR implementing the solution we agree on. I am more inclined to use the * now, but honestly I would easily accept PRs with the alternative solution as well.

LUCKIN13 and others added 6 commits November 23, 2024 00:11
* DOC: Add drag for airbrakes

* DOC: Add flight data

* DOC : Add actuation from the aibrakes. (not needed but saved in case of corrections)

* DOC: Updates/ Fixes to simulation file

* DOC: Add simulation to index

* DEV: changelog
* DOCS: Add drag files for faraday flight example

* DOCS: add measured data

* DOCS: Add Faraday flight example from 2023

* DOC: Fix and update simulation file

* DOC: run black

* DOC: Change data folder name

* DOC: Rename simulation example file

* DOC: Add Example to index

* DEV: Changelog

* DOC: Update drag in simulation

---------

Co-authored-by: Gui-FernandesBR <[email protected]>
…tion (#735)

* forecast_reanalysis - move wind_speed to correct position

* forecast_reanalysis - move wind_speed to correct position

* DEV: adds #735 to CHANGELOG

---------

Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
…ables dictionary (#736)

* forecast_reanalysis - move wind_speed to correct position

* forecast_reanalysis - move wind_speed to correct position

* DEV: adds #735 to CHANGELOG

* update ECMWF dictionary values

* allow depreciated .nc files

* allow .nc files with only one time variable

* TST? parameterize acceptance test for NDRT 2020 rocket data with multiple environment files

* STY: apply black

---------

Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
@Gui-FernandesBR
Copy link
Member Author

just to be clear... we would be removing the filename argument to **kwargs ?

That is one possibility. It makes more sense if we had many parameters, like matplotlib does here (scroll down to the kwargs section): https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html
The way you solved it should also work, if you prefer. The difference between them is that kwargs would allow any names to be a "named parameter".

@phmbressan I reflected on both options, they both are pretty similar to be honest. The idea is to enforce that no one ever uses the filename as a positional argument.

The only advantage I see in using the * operator is for type hinting purposes, since it would allow us to specify the type of the inputs. I know we do not use type hints in this project yet, but I have a dream one day someone will convince @MateusStano of using that!

Aside that fact, I see no other reason for any preference here. What do you think? Do you agree?

I believe we should make a new PR implementing the solution we agree on. I am more inclined to use the * now, but honestly I would easily accept PRs with the alternative solution as well.

@phmbressan we need to address this filename/kwargs situation. It is currently blocking us from our next release.
Are we really going to change the filename arguments? How are we going to do so, and who is assigned to address it?
I don't have time to work on this right now, sadly.

Ideally, the next release should happen still in November.

phmbressan and others added 7 commits November 29, 2024 23:44
* MNT: Place filename save parameter to the end.

* DEV: Add TODO for refactoring CompareFlights class to use show_or_save_plot

---------

Co-authored-by: Gui-FernandesBR <[email protected]>
* DOC: improvements to developers documentation

* MNT: git rename a few files from the root directory

* DOC: more upgrades to development docs

* DEV: create script to delete local branches that no longer exist on remote

* DOC: I followed the step by step, looked at other parts of the documentation, and didn't find anything to correct or improve. I think it's fine as it is. I added a model to requirements.txt, which was missing when I ran the make html command.

* DOC: Update developer docs on sphinx building.

* DOC: Clarify testing structure on testing docs.

* DOC: Re-run docs requirements freeze.

* DOC: Introduce Conflicts Guideline and update First PR.

* DOC: fixing typos on development docs.

* DOC: Solve review comments of dev docs.

* DOC: final touches to developers documentation

* DOC: update cSpell configuration to enable additional file types

* DEV: move docker ignore file

---------

Co-authored-by: Julio Machado <[email protected]>
Co-authored-by: Pedro Bressan <[email protected]>
Co-authored-by: Lucas de Oliveira Prates <[email protected]>
@Gui-FernandesBR Gui-FernandesBR merged commit 551d25a into master Nov 30, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

8 participants