Skip to content

Commit 5ff3476

Browse files
authored
Merge pull request #483 from RocketPy-Team/hotfix/v1.1.1
HOTFIX: v1.1.1
2 parents 7d45342 + 6015dcc commit 5ff3476

File tree

14 files changed

+712
-359
lines changed

14 files changed

+712
-359
lines changed

.github/pull_request_template.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
<!-- 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! -->
44

55
## Pull request type
6+
<!-- Remove unchecked box items. -->
67

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

1213
## Checklist
14+
<!-- Remove irrelevant items to this PR. -->
1315

1416
- [ ] Tests for the changes have been added (if needed)
1517
- [ ] Docs have been reviewed and added / updated
1618
- [ ] Lint (`black rocketpy/ tests/`) has passed locally
1719
- [ ] All tests (`pytest --runslow`) have passed locally
20+
- [ ] `CHANGELOG.md` has been updated (if relevant)
1821

1922
## Current behavior
2023
<!-- Describe current behavior or link to an issue. -->
@@ -27,12 +30,12 @@ Enter text here...
2730
Enter text here...
2831

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

3235
- [ ] Yes
3336
- [ ] No
3437

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

3841
Enter text here...

CHANGELOG.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# RocketPy Change Log
2+
3+
All notable changes to `RocketPy` project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
<!-- Types of changes:
9+
- `Added` for new features.
10+
- `Changed` for changes in existing functionality.
11+
- `Deprecated` for soon-to-be removed features.
12+
- `Removed` for now removed features.
13+
- `Fixed` for any bug fixes.
14+
- `Security` in case of vulnerabilities.
15+
16+
Should not be here:
17+
- tests
18+
- github maintenance
19+
- merge commits
20+
21+
Types of messages:
22+
- Usually the message is the PR title and number
23+
- If the PR is too long to accomplish all the changes (it shouldn't be...),
24+
you can use a second line to describe it
25+
26+
-->
27+
28+
## [Unreleased] - yyyy-mm-dd
29+
30+
Here we write upgrading notes for brands. It's a team effort to make them as
31+
straightforward as possible.
32+
33+
### Added
34+
35+
-
36+
37+
### Changed
38+
39+
-
40+
41+
### Fixed
42+
43+
-
44+
45+
46+
## [v1.1.1] - 2023-11-23
47+
48+
You can install this version by running `pip install rocketpy==1.1.1`
49+
50+
51+
### Added
52+
53+
- DOC: Added this changelog file [#472](https://github.com/RocketPy-Team/RocketPy/pull/472)
54+
- ENH: Prevent out of bounds Tanks from Instantiation #484 [#484](https://github.com/RocketPy-Team/RocketPy/pull/484)
55+
56+
### Fixed
57+
58+
- HOTFIX: Negative Static Margin [#476](https://github.com/RocketPy-Team/RocketPy/pull/476)
59+
- HOTFIX: 2D .CSV Function and missing set_get_value_opt call [#478](https://github.com/RocketPy-Team/RocketPy/pull/478)
60+
- HOTFIX: Tanks Overfill not Being Detected [#479](https://github.com/RocketPy-Team/RocketPy/pull/479)
61+
62+
## [v1.1.0] - 2023-11-19
63+
64+
You can install this version by running `pip install rocketpy==1.1.0`
65+
66+
### Added
67+
68+
- DOC: Documentation for Function Class Usage [#465](https://github.com/RocketPy-Team/RocketPy/pull/465)
69+
- DOC: first simulation all_info [#466](https://github.com/RocketPy-Team/RocketPy/pull/466)
70+
- ENH: draw motors [#436](https://github.com/RocketPy-Team/RocketPy/pull/436)
71+
- DOC: add documentation for flight data export. [#464](https://github.com/RocketPy-Team/RocketPy/pull/464)
72+
- ENH: Add mass_flow_rate() to GenericMotor class [#459](https://github.com/RocketPy-Team/RocketPy/pull/459)
73+
- DOC: Add documentation on how to build the docs [#452](https://github.com/RocketPy-Team/RocketPy/pull/452)
74+
- ENH: new Flight.get_solution_at_time() method [#441](https://github.com/RocketPy-Team/RocketPy/pull/441)
75+
- ENH: rocket drawing [419](https://github.com/RocketPy-Team/RocketPy/pull/419)
76+
- ENH: Adding Stability Margin with Mach dependency [#377](https://github.com/RocketPy-Team/RocketPy/pull/377)
77+
78+
### Changed
79+
80+
- ENH: Spherical Caps Included in Total Length [#455](https://github.com/RocketPy-Team/RocketPy/pull/455)
81+
- Important: This changes behavior of `TankGeometry.add_spherical_caps()`
82+
- ENH: Clean Plots and Prints sub packages init files [#457](https://github.com/RocketPy-Team/RocketPy/pull/457)
83+
- ENH: Add \_MotorPlots Inheritance to Motor Plots Classes [#456](https://github.com/RocketPy-Team/RocketPy/pull/456)
84+
- DOC: organize flight examples folder [#429](https://github.com/RocketPy-Team/RocketPy/pull/429)
85+
- DOC: improve mass and inertia docs [#445](https://github.com/RocketPy-Team/RocketPy/pull/445)
86+
87+
### Fixed
88+
89+
- MNT: Refactor exhaust velocity calculation to avoid ZeroDivisionError [#470](https://github.com/RocketPy-Team/RocketPy/pull/470)
90+
- BUG: Fix find_input() Function to Return a Single Value [#471](https://github.com/RocketPy-Team/RocketPy/pull/471)
91+
- DOC: refactor dispersion analysis notebook [#463](https://github.com/RocketPy-Team/RocketPy/pull/463)
92+
- BUG: User input checks added for Function class [#451](https://github.com/RocketPy-Team/RocketPy/pull/451)
93+
- DOC: fix positions and coordinate system documentation page [#454](https://github.com/RocketPy-Team/RocketPy/pull/)
94+
- MNT: fix env plots legends [#440](https://github.com/RocketPy-Team/RocketPy/pull/440)
95+
- BUG: flight.prints.max_values() fails when launching an EmptyMotor [#438](https://github.com/RocketPy-Team/RocketPy/pull/438)
96+
- BUG: Maintaining Extrapolation when Adding Discrete Functions with Constants [#432](https://github.com/RocketPy-Team/RocketPy/pull/432)
97+
- MNT: Fix env plots max heights [#433](https://github.com/RocketPy-Team/RocketPy/pull/433)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = "RocketPy Team"
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = "1.1.0"
27+
release = "1.1.1"
2828

2929

3030
# -- General configuration ---------------------------------------------------

docs/examples/SEB_liquid_motor.ipynb

Lines changed: 270 additions & 287 deletions
Large diffs are not rendered by default.

docs/user/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins
1919

2020
.. code-block:: shell
2121
22-
pip install rocketpy==1.1.0
22+
pip install rocketpy==1.1.1
2323
2424
2525
Optional Installation Method: ``conda``

rocketpy/mathutils/function.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,6 @@ def source_function(_):
229229

230230
# Finally set data source as source
231231
self.source = source
232-
# Update extrapolation method
233-
if self.__extrapolation__ is None:
234-
self.set_extrapolation()
235-
# Set default interpolation for point source if it hasn't
236-
if self.__interpolation__ is None:
237-
self.set_interpolation()
238-
else:
239-
# Updates interpolation coefficients
240-
self.set_interpolation(self.__interpolation__)
241232
# Do things if function is multivariate
242233
else:
243234
self.x_array = source[:, 0]
@@ -251,6 +242,15 @@ def source_function(_):
251242

252243
# Finally set data source as source
253244
self.source = source
245+
# Update extrapolation method
246+
if self.__extrapolation__ is None:
247+
self.set_extrapolation()
248+
# Set default interpolation for point source if it hasn't
249+
if self.__interpolation__ is None:
250+
self.set_interpolation()
251+
else:
252+
# Updates interpolation coefficients
253+
self.set_interpolation(self.__interpolation__)
254254
return self
255255

256256
@cached_property
@@ -329,7 +329,7 @@ def set_extrapolation(self, method="constant"):
329329
def set_get_value_opt(self):
330330
"""Crates a method that evaluates interpolations rather quickly
331331
when compared to other options available, such as just calling
332-
the object instance or calling ``Function.get_value directly``. See
332+
the object instance or calling ``Function.get_value`` directly. See
333333
``Function.get_value_opt`` for documentation.
334334
335335
Returns
@@ -2715,7 +2715,7 @@ def compose(self, func, extrapolate=False):
27152715
if isinstance(self.source, np.ndarray) and isinstance(func.source, np.ndarray):
27162716
# Perform bounds check for composition
27172717
if not extrapolate:
2718-
if func.min < self.x_initial and func.max > self.x_final:
2718+
if func.min < self.x_initial or func.max > self.x_final:
27192719
raise ValueError(
27202720
f"Input Function image {func.min, func.max} must be within "
27212721
f"the domain of the Function {self.x_initial, self.x_final}."
@@ -2785,7 +2785,8 @@ def _check_user_input(
27852785
dimensions of inputs and outputs. If the outputs list has more than
27862786
one element.
27872787
TypeError
2788-
If the source is not a list, np.ndarray, or Function object.
2788+
If the source is not a list, np.ndarray, Function object, str or
2789+
Path.
27892790
Warning
27902791
If inputs or outputs do not match for a Function source, or if
27912792
defaults are used for inputs, interpolation,and extrapolation for a
@@ -2825,10 +2826,16 @@ def _check_user_input(
28252826

28262827
# check source for data type
28272828
# if list or ndarray, check for dimensions, interpolation and extrapolation
2828-
if isinstance(source, (list, np.ndarray)):
2829-
# this will also trigger an error if the source is not a list of
2830-
# numbers or if the array is not homogeneous
2831-
source = np.array(source, dtype=np.float64)
2829+
if isinstance(source, (list, np.ndarray, str, Path)):
2830+
# Deal with csv or txt
2831+
if isinstance(source, (str, Path)):
2832+
# Convert to numpy array
2833+
source = np.loadtxt(source, delimiter=",", dtype=float)
2834+
2835+
else:
2836+
# this will also trigger an error if the source is not a list of
2837+
# numbers or if the array is not homogeneous
2838+
source = np.array(source, dtype=np.float64)
28322839

28332840
# check dimensions
28342841
source_dim = source.shape[1]

0 commit comments

Comments
 (0)