Skip to content

Commit 5141791

Browse files
committed
MNT: improve object encoding and file handling.
1 parent 8671e52 commit 5141791

File tree

6 files changed

+321
-462
lines changed

6 files changed

+321
-462
lines changed

docs/notebooks/monte_carlo_analysis/monte_carlo_analysis_outputs/monte_carlo_class_example.inputs.txt

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

docs/notebooks/monte_carlo_analysis/monte_carlo_analysis_outputs/monte_carlo_class_example.kml

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

docs/notebooks/monte_carlo_analysis/monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt

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

docs/notebooks/monte_carlo_analysis/monte_carlo_class_usage.ipynb

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
{
231231
"data": {
232232
"application/vnd.jupyter.widget-view+json": {
233-
"model_id": "c0480c4e31b842fba64def79efc6efac",
233+
"model_id": "bad56b36f7ea4202ad8ae4e538587850",
234234
"version_major": 2,
235235
"version_minor": 0
236236
},
@@ -507,7 +507,7 @@
507507
"name": "stdout",
508508
"output_type": "stream",
509509
"text": [
510-
"[7166.955881900554, 7020.247272048751, 7311.367348420168, 5346.563222509409, 5624.919119779475]\n"
510+
"[4391.364691514904, 7219.639007049733, 6453.201220132505, 8224.181709280812, 7533.468077292466]\n"
511511
]
512512
}
513513
],
@@ -776,24 +776,24 @@
776776
},
777777
{
778778
"cell_type": "code",
779-
"execution_count": 20,
779+
"execution_count": 15,
780780
"metadata": {},
781781
"outputs": [
782782
{
783783
"name": "stdout",
784784
"output_type": "stream",
785785
"text": [
786786
"The following input file was imported: monte_carlo_analysis_outputs/monte_carlo_class_example.inputs.txt\n",
787-
"A total of 10 simulations results were loaded from the following output file: monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt\n",
787+
"A total of 0 simulations results were loaded from the following output file: monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt\n",
788788
"\n",
789-
"The following error file was imported: monte_carlo_analysis_outputs/monte_carlo_class_example.errors.txt \n"
789+
"The following error file was imported: monte_carlo_analysis_outputs/monte_carlo_class_example.errors.txt \n"
790790
]
791791
},
792792
{
793793
"name": "stderr",
794794
"output_type": "stream",
795795
"text": [
796-
"/home/phmb/github/RocketPy/rocketpy/simulation/monte_carlo.py:135: UserWarning: This class is still under testing and some attributes may be changed in next versions\n",
796+
"/home/phmb/github/RocketPy/rocketpy/simulation/monte_carlo.py:123: UserWarning: This class is still under testing and some attributes may be changed in next versions\n",
797797
" warnings.warn(\n"
798798
]
799799
}
@@ -820,7 +820,7 @@
820820
},
821821
{
822822
"cell_type": "code",
823-
"execution_count": 21,
823+
"execution_count": 16,
824824
"metadata": {},
825825
"outputs": [
826826
{
@@ -834,10 +834,10 @@
834834
"name": "stdout",
835835
"output_type": "stream",
836836
"text": [
837-
"Current iteration: 000099 | Average Time per Iteration: 0.559 s | Estimated time left: 0 s \n",
837+
"Current iteration: 000098 | Average Time per Iteration: 0.584 s | Estimated time left: 0 s \n",
838838
"Completed 100 iterations. In total, 100 simulations are exported.\n",
839-
"Total wall time: 59.0 s \n",
840-
"Results saved to /home/phmb/github/RocketPy/docs/notebooks/monte_carlo_analysis/monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt\n"
839+
"Total wall time: 61.4 s \n",
840+
"Results saved to monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt\n"
841841
]
842842
}
843843
],
@@ -877,15 +877,21 @@
877877
},
878878
{
879879
"cell_type": "code",
880-
"execution_count": 22,
880+
"execution_count": 17,
881881
"metadata": {},
882882
"outputs": [
883883
{
884884
"name": "stdout",
885885
"output_type": "stream",
886886
"text": [
887887
"A total of 100 simulations results were loaded from the following output file: monte_carlo_analysis_outputs/monte_carlo_class_example.outputs.txt\n",
888-
"\n",
888+
"\n"
889+
]
890+
},
891+
{
892+
"name": "stdout",
893+
"output_type": "stream",
894+
"text": [
889895
"The following input file was imported: monte_carlo_analysis_outputs/monte_carlo_class_example.inputs.txt \n",
890896
"The following error file was imported: monte_carlo_analysis_outputs/monte_carlo_class_example.errors.txt\n"
891897
]
@@ -898,7 +904,7 @@
898904
},
899905
{
900906
"cell_type": "code",
901-
"execution_count": 23,
907+
"execution_count": 18,
902908
"metadata": {},
903909
"outputs": [
904910
{
@@ -907,7 +913,7 @@
907913
"100"
908914
]
909915
},
910-
"execution_count": 23,
916+
"execution_count": 18,
911917
"metadata": {},
912918
"output_type": "execute_result"
913919
}
@@ -918,7 +924,7 @@
918924
},
919925
{
920926
"cell_type": "code",
921-
"execution_count": 24,
927+
"execution_count": 19,
922928
"metadata": {},
923929
"outputs": [
924930
{
@@ -932,21 +938,21 @@
932938
"\n",
933939
" Parameter Mean Std. Dev.\n",
934940
"------------------------------------------------------------\n",
935-
" max_mach_number 0.816 0.120\n",
936-
" x_impact 605.881 135.419\n",
937-
" impact_velocity -5.315 0.096\n",
938-
" out_of_rail_time 0.367 0.027\n",
939-
" apogee_y 384.855 88.737\n",
940-
"out_of_rail_stability_margin 2.689 0.074\n",
941-
" t_final 293.980 33.404\n",
941+
" impact_velocity -5.279 0.095\n",
942+
" out_of_rail_time 0.357 0.023\n",
943+
" max_mach_number 0.868 0.115\n",
944+
"out_of_rail_stability_margin 2.659 0.076\n",
945+
" apogee_time 25.608 1.703\n",
946+
" initial_stability_margin 2.598 0.078\n",
947+
" y_impact 460.823 64.165\n",
948+
" out_of_rail_velocity 25.972 1.930\n",
942949
" frontal_surface_wind 0.000 0.000\n",
943-
" apogee 3191.017 588.334\n",
944-
" out_of_rail_velocity 25.088 2.014\n",
950+
" apogee_y 395.028 58.848\n",
951+
" apogee_x 511.538 75.630\n",
945952
" lateral_surface_wind 0.000 0.000\n",
946-
" initial_stability_margin 2.626 0.075\n",
947-
" apogee_x 518.860 121.948\n",
948-
" y_impact 449.608 98.838\n",
949-
" apogee_time 24.864 2.100\n"
953+
" x_impact 596.502 81.968\n",
954+
" t_final 306.494 30.999\n",
955+
" apogee 3419.338 530.485\n"
950956
]
951957
}
952958
],
@@ -990,7 +996,7 @@
990996
},
991997
{
992998
"cell_type": "code",
993-
"execution_count": null,
999+
"execution_count": 20,
9941000
"metadata": {},
9951001
"outputs": [],
9961002
"source": [

0 commit comments

Comments
 (0)