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

ENH: update master with develop for version 1.2.0 #536

Merged
merged 301 commits into from
Feb 12, 2024
Merged

Conversation

Gui-FernandesBR
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR commented Jan 21, 2024

Pull request type

  • ReadMe, Docs and GitHub updates

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

RocketPy version 1.1.X

New behavior

RocketPy get news features so we update it to 1.2.0.
See the CHANGELOG.md for more details.

Breaking change

  • No

Additional information

I'm creating this draft PR so we can start reviewing it AND to check how the github actions are performing when the head branch is the master.

phmbressan and others added 30 commits November 28, 2023 14:00
ENH: Function Reverse Arithmetic Priority
While studying some of the tests that were written, I made some simple changes to conftest.py, test_function.py and test_solidmotor.py.
ENH: Parachute trigger doesn't work if "Apogee" is used instead of "apogee"
MNT: Add __repr__ method to Parachute class
New folders were created (called 'unit' and 'integration') and a test module named 'test_function.py' was put inside the folder called 'unit.'
Removing output.json, pytest_html_report.html and the other unnecessary file of the last commit.
TST: solid_motor.py testing refactors
Copy link
Member Author

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

Now I believe I've checked every file.

I'm going to open a PR solving the small comments I've made above.

.github/pull_request_template.md Outdated Show resolved Hide resolved
.github/workflows/test_pytest.yaml Outdated Show resolved Hide resolved
.pylintrc Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
rocketpy/simulation/flight_data_importer.py Outdated Show resolved Hide resolved
@Gui-FernandesBR Gui-FernandesBR mentioned this pull request Feb 8, 2024
5 tasks
Copy link
Collaborator

@phmbressan phmbressan left a comment

Choose a reason for hiding this comment

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

Great to see this release on its final steps.

Something that stood out to me is that most of the developed features also had a set of tests.

.github/pull_request_template.md Show resolved Hide resolved
@@ -69,6 +69,7 @@ So here are a couple of **guidelines** to help you when creating new branches to
#. ``enh``: when you add new features and enhancements
#. ``maint``: when your branch is all about refactoring, fixing typos, etc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, mnt is already quite often being used here.

Comment on lines 2315 to 2317
if isinstance(
other, (float, int, complex, np.ndarray, np.integer, np.floating)
):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, my suggestion would be creating a class variable, e.g. ARITHMETIC_TYPES.

In another opportunity we could also double check if there are no redundancies in these types and if there is no other way to support arithmetic with np types besides enumerating all of them.

@Gui-FernandesBR
Copy link
Member Author

I agree, my suggestion would be creating a class variable, e.g. ARITHMETIC_TYPES.

In another opportunity we could also double check if there are no redundancies in these types and if there is no other way to support arithmetic with np types besides enumerating all of them.

Is it really better to make it a class attribute? We may need this being used out of the Function class eventually, therefore not attaching this constant to a class might be a better idea imo. I would simply define it at the top of the file as a python constant variable in UPPERCASE

@phmbressan
Copy link
Collaborator

Is it really better to make it a class attribute? We may need this being used out of the Function class eventually, therefore not attaching this constant to a class might be a better idea imo. I would simply define it at the top of the file as a python constant variable in UPPERCASE

Both solutions work of course.

My argument for it being a class variable (a variable pertaining to the class, such as Function.ARITHMETIC_TYPES) is that I believe that this variable only makes sense in a Function class related context.

In the end, the choice is mostly stylistic and I agree with answer given here . To sum up, I am perfectly happy with both ways, although I have a small semantic preference toward a class variable.

BUG: Update flight trajectory plot axes limits
@Gui-FernandesBR
Copy link
Member Author

@phmbressan I recommend you reading this page: https://numpy.org/doc/stable/reference/generated/numpy.isscalar.html

No, using isscalar doesn't save our lives because a string is also a scalar apparently (???).
But they do a good recommendation: """If you need a stricter way to identify a numerical scalar, use isinstance(x, numbers.Number), as that returns False for most non-numerical elements such as strings."""

@Gui-FernandesBR Gui-FernandesBR merged commit 9055923 into master Feb 12, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Releases Related with new releases
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.