Skip to content

Commit a887ad2

Browse files
BUG: Fix the method to add parachutes to the rocket
The code changes in `nb_builder.py` add a new method `add_parachutes_to_rocket` to the `NotebookBuilder` class. This method adds parachutes to the rocket by updating the `rocket.parachutes` attribute with the values from the `parachutes` dictionary. This commit message follows the established convention of using a prefix to indicate the type of change (`feat` for a new feature) and provides a clear and concise description of the purpose of the code changes.
1 parent fefd1a3 commit a887ad2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rocketserializer/nb_builder.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def build_rocket(self, nb: nbf.v4.new_notebook):
226226
)
227227
nb["cells"].append(nbf.v4.new_code_cell(text))
228228

229-
# add a code cell
229+
nb = self.add_parachutes_to_rocket(nb)
230+
230231
text = "### Rocket Info\n"
231232
text += "rocket.all_info()\n"
232233
nb["cells"].append(nbf.v4.new_code_cell(text))
@@ -475,9 +476,11 @@ def build_parachute(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:
475476
text += ")\n"
476477
nb["cells"].append(nbf.v4.new_code_cell(text))
477478

479+
def add_parachutes_to_rocket(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:
480+
478481
text = "Adding parachutes to the rocket\n"
479482
nb["cells"].append(nbf.v4.new_markdown_cell(text))
480-
text = "rocket.parachutes = parachutes\n"
483+
text = "rocket.parachutes = list(parachutes.values())\n"
481484
nb["cells"].append(nbf.v4.new_code_cell(text))
482485

483486
logger.info("[NOTEBOOK BUILDER] Parachutes created.")

0 commit comments

Comments
 (0)