Skip to content

Commit

Permalink
BUG: Fix the method to add parachutes to the rocket
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gui-FernandesBR committed Jun 15, 2024
1 parent fefd1a3 commit a887ad2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rocketserializer/nb_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def build_rocket(self, nb: nbf.v4.new_notebook):
)
nb["cells"].append(nbf.v4.new_code_cell(text))

# add a code cell
nb = self.add_parachutes_to_rocket(nb)

text = "### Rocket Info\n"
text += "rocket.all_info()\n"
nb["cells"].append(nbf.v4.new_code_cell(text))
Expand Down Expand Up @@ -475,9 +476,11 @@ def build_parachute(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:
text += ")\n"
nb["cells"].append(nbf.v4.new_code_cell(text))

def add_parachutes_to_rocket(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:

text = "Adding parachutes to the rocket\n"
nb["cells"].append(nbf.v4.new_markdown_cell(text))
text = "rocket.parachutes = parachutes\n"
text = "rocket.parachutes = list(parachutes.values())\n"
nb["cells"].append(nbf.v4.new_code_cell(text))

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

0 comments on commit a887ad2

Please sign in to comment.