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

REL: v1.1.1 #483

Merged
merged 31 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f68b4b6
DOC: Add RocketPy change log file
Gui-FernandesBR Nov 20, 2023
a78d073
ENH: Add update change log file to PR template checklist
giovaniceotto Nov 20, 2023
5ba238c
DOC: Added changelog file with pull request link
Gui-FernandesBR Nov 20, 2023
3d3d982
Merge pull request #472 from RocketPy-Team/doc/add-changelog
Gui-FernandesBR Nov 20, 2023
a110794
FIX: remove double sign correction for static margin
giovaniceotto Nov 21, 2023
a08790b
REL: Bump version to 1.1.1
giovaniceotto Nov 21, 2023
b16ac87
TST: fixes test that checks coordinate systems
giovaniceotto Nov 21, 2023
f398875
MNT: Remove unnecessary matplotlib mock show
giovaniceotto Nov 21, 2023
88a2991
BUG: fix Function compose extrapolation check.
phmbressan Nov 21, 2023
09260e4
FIX: MassBasedTank out of bounds check not working.
phmbressan Nov 21, 2023
54c30f8
BUG: fix 2d csv Function definition and missing set_get_value_opt
MateusStano Nov 21, 2023
9f69c74
TST: fix test of MassBasedTank overfill.
phmbressan Nov 21, 2023
d1a5dd5
DOC: update SEB doc with correct density values.
phmbressan Nov 21, 2023
0b2eb80
TST: add tests with 2d csv Funciton
MateusStano Nov 21, 2023
8abe6af
BUG: typo in conftest
MateusStano Nov 21, 2023
21e9f58
STY: apply black for linting.
phmbressan Nov 21, 2023
8428fd8
Merge pull request #476 from RocketPy-Team/hotfix/negative-static-margin
MateusStano Nov 21, 2023
2ee958a
MNT: few docs fix and remove extra np.array conversion for csvs
MateusStano Nov 22, 2023
e18ca22
Merge pull request #478 from RocketPy-Team/hotfix/csv-2d-function
MateusStano Nov 22, 2023
6894dd4
DOC: improve MassBasedTank over volume error message.
phmbressan Nov 22, 2023
527fe89
Merge pull request #479 from RocketPy-Team/bug/tanks-overfill
MateusStano Nov 23, 2023
bf833c6
MNT: run SEB notebook
MateusStano Nov 23, 2023
3434ae9
MNT: update changelog.md
MateusStano Nov 23, 2023
0b28b2c
ENH: prevent out of bounds Tanks from construction.
phmbressan Nov 23, 2023
72d8c56
STY: apply black for linting.
phmbressan Nov 23, 2023
a17790a
MNT: improve error messages for Tank out of bounds filling.
phmbressan Nov 24, 2023
6d1d7bd
DOC: add to changelog
MateusStano Nov 24, 2023
dab946d
Merge branch 'hotfix/v1.1.1' into bug/tanks-overfill
MateusStano Nov 24, 2023
553c0f7
Merge pull request #484 from RocketPy-Team/bug/tanks-overfill
MateusStano Nov 24, 2023
4765654
Update tests/test_tank.py
phmbressan Nov 24, 2023
6015dcc
TST: fix error in test assertion.
phmbressan Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
<!-- You may use this template to describe your Pull Request. But if you believe there is a better way to express yourself, don't hesitate! -->

## Pull request type
<!-- Remove unchecked box items. -->

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

## Checklist
<!-- Remove irrelevant items to this PR. -->

- [ ] 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
<!-- Describe current behavior or link to an issue. -->
Expand All @@ -27,12 +30,12 @@ Enter text here...
Enter text here...

## Breaking change
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. Remove the unchecked box item. -->

- [ ] Yes
- [ ] No

## Additional information
<!-- Include any relevant details or screenshots. -->
<!-- Include any relevant details or screenshots. If none, remove this section. -->

Enter text here...
97 changes: 97 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# RocketPy Change Log

All notable changes to `RocketPy` project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

<!-- Types of changes:
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

Should not be here:
- tests
- github maintenance
- merge commits

Types of messages:
- Usually the message is the PR title and number
- If the PR is too long to accomplish all the changes (it shouldn't be...),
you can use a second line to describe it

-->

## [Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as
straightforward as possible.

### Added

-

### Changed

-

### Fixed

-


## [v1.1.1] - 2023-11-23

You can install this version by running `pip install rocketpy==1.1.1`


### Added

- DOC: Added this changelog file [#472](https://github.com/RocketPy-Team/RocketPy/pull/472)
- ENH: Prevent out of bounds Tanks from Instantiation #484 [#484](https://github.com/RocketPy-Team/RocketPy/pull/484)

### Fixed

- HOTFIX: Negative Static Margin [#476](https://github.com/RocketPy-Team/RocketPy/pull/476)
- HOTFIX: 2D .CSV Function and missing set_get_value_opt call [#478](https://github.com/RocketPy-Team/RocketPy/pull/478)
- HOTFIX: Tanks Overfill not Being Detected [#479](https://github.com/RocketPy-Team/RocketPy/pull/479)

## [v1.1.0] - 2023-11-19

You can install this version by running `pip install rocketpy==1.1.0`

### Added

- DOC: Documentation for Function Class Usage [#465](https://github.com/RocketPy-Team/RocketPy/pull/465)
- DOC: first simulation all_info [#466](https://github.com/RocketPy-Team/RocketPy/pull/466)
- ENH: draw motors [#436](https://github.com/RocketPy-Team/RocketPy/pull/436)
- DOC: add documentation for flight data export. [#464](https://github.com/RocketPy-Team/RocketPy/pull/464)
- ENH: Add mass_flow_rate() to GenericMotor class [#459](https://github.com/RocketPy-Team/RocketPy/pull/459)
- DOC: Add documentation on how to build the docs [#452](https://github.com/RocketPy-Team/RocketPy/pull/452)
- ENH: new Flight.get_solution_at_time() method [#441](https://github.com/RocketPy-Team/RocketPy/pull/441)
- ENH: rocket drawing [419](https://github.com/RocketPy-Team/RocketPy/pull/419)
- ENH: Adding Stability Margin with Mach dependency [#377](https://github.com/RocketPy-Team/RocketPy/pull/377)

### Changed

- ENH: Spherical Caps Included in Total Length [#455](https://github.com/RocketPy-Team/RocketPy/pull/455)
- Important: This changes behavior of `TankGeometry.add_spherical_caps()`
- ENH: Clean Plots and Prints sub packages init files [#457](https://github.com/RocketPy-Team/RocketPy/pull/457)
- ENH: Add \_MotorPlots Inheritance to Motor Plots Classes [#456](https://github.com/RocketPy-Team/RocketPy/pull/456)
- DOC: organize flight examples folder [#429](https://github.com/RocketPy-Team/RocketPy/pull/429)
- DOC: improve mass and inertia docs [#445](https://github.com/RocketPy-Team/RocketPy/pull/445)

### Fixed

- MNT: Refactor exhaust velocity calculation to avoid ZeroDivisionError [#470](https://github.com/RocketPy-Team/RocketPy/pull/470)
- BUG: Fix find_input() Function to Return a Single Value [#471](https://github.com/RocketPy-Team/RocketPy/pull/471)
- DOC: refactor dispersion analysis notebook [#463](https://github.com/RocketPy-Team/RocketPy/pull/463)
- BUG: User input checks added for Function class [#451](https://github.com/RocketPy-Team/RocketPy/pull/451)
- DOC: fix positions and coordinate system documentation page [#454](https://github.com/RocketPy-Team/RocketPy/pull/)
- MNT: fix env plots legends [#440](https://github.com/RocketPy-Team/RocketPy/pull/440)
- BUG: flight.prints.max_values() fails when launching an EmptyMotor [#438](https://github.com/RocketPy-Team/RocketPy/pull/438)
- BUG: Maintaining Extrapolation when Adding Discrete Functions with Constants [#432](https://github.com/RocketPy-Team/RocketPy/pull/432)
- MNT: Fix env plots max heights [#433](https://github.com/RocketPy-Team/RocketPy/pull/433)
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = "RocketPy Team"

# The full version, including alpha/beta/rc tags
release = "1.1.0"
release = "1.1.1"


# -- General configuration ---------------------------------------------------
Expand Down
557 changes: 270 additions & 287 deletions docs/examples/SEB_liquid_motor.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins

.. code-block:: shell

pip install rocketpy==1.1.0
pip install rocketpy==1.1.1


Optional Installation Method: ``conda``
Expand Down
39 changes: 23 additions & 16 deletions rocketpy/mathutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,6 @@ def source_function(_):

# Finally set data source as source
self.source = source
# Update extrapolation method
if self.__extrapolation__ is None:
self.set_extrapolation()
# Set default interpolation for point source if it hasn't
if self.__interpolation__ is None:
self.set_interpolation()
else:
# Updates interpolation coefficients
self.set_interpolation(self.__interpolation__)
# Do things if function is multivariate
else:
self.x_array = source[:, 0]
Expand All @@ -251,6 +242,15 @@ def source_function(_):

# Finally set data source as source
self.source = source
# Update extrapolation method
if self.__extrapolation__ is None:
self.set_extrapolation()
# Set default interpolation for point source if it hasn't
if self.__interpolation__ is None:
self.set_interpolation()
else:
# Updates interpolation coefficients
self.set_interpolation(self.__interpolation__)
return self

@cached_property
Expand Down Expand Up @@ -329,7 +329,7 @@ def set_extrapolation(self, method="constant"):
def set_get_value_opt(self):
"""Crates a method that evaluates interpolations rather quickly
when compared to other options available, such as just calling
the object instance or calling ``Function.get_value directly``. See
the object instance or calling ``Function.get_value`` directly. See
``Function.get_value_opt`` for documentation.

Returns
Expand Down Expand Up @@ -2715,7 +2715,7 @@ def compose(self, func, extrapolate=False):
if isinstance(self.source, np.ndarray) and isinstance(func.source, np.ndarray):
# Perform bounds check for composition
if not extrapolate:
if func.min < self.x_initial and func.max > self.x_final:
if func.min < self.x_initial or func.max > self.x_final:
raise ValueError(
f"Input Function image {func.min, func.max} must be within "
f"the domain of the Function {self.x_initial, self.x_final}."
Expand Down Expand Up @@ -2785,7 +2785,8 @@ def _check_user_input(
dimensions of inputs and outputs. If the outputs list has more than
one element.
TypeError
If the source is not a list, np.ndarray, or Function object.
If the source is not a list, np.ndarray, Function object, str or
Path.
Warning
If inputs or outputs do not match for a Function source, or if
defaults are used for inputs, interpolation,and extrapolation for a
Expand Down Expand Up @@ -2825,10 +2826,16 @@ def _check_user_input(

# check source for data type
# if list or ndarray, check for dimensions, interpolation and extrapolation
if isinstance(source, (list, np.ndarray)):
# this will also trigger an error if the source is not a list of
# numbers or if the array is not homogeneous
source = np.array(source, dtype=np.float64)
if isinstance(source, (list, np.ndarray, str, Path)):
# Deal with csv or txt
if isinstance(source, (str, Path)):
# Convert to numpy array
source = np.loadtxt(source, delimiter=",", dtype=float)

else:
# this will also trigger an error if the source is not a list of
# numbers or if the array is not homogeneous
source = np.array(source, dtype=np.float64)

# check dimensions
source_dim = source.shape[1]
Expand Down
Loading
Loading