Skip to content

Commit

Permalink
fix scripts folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed Oct 16, 2024
1 parent 3e7c7bb commit fd6efa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/demo/scripts/customise_interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
from wsimod.orchestration.model import Model, to_datetime

# Identify the location of the scripts folder
data_folder = os.path.join(os.path.abspath(""), "docs", "demo", "scripts")
scripts_folder = os.path.join(os.path.abspath(""), "docs", "demo", "scripts")

# Create temporary directory
temp_dir = tempfile.TemporaryDirectory()
Expand Down Expand Up @@ -133,7 +133,7 @@
# We can customise our model with this handler by specifying it under the
# `extensions` attribute and reloading the model to apply the extension.
# %%
my_model.extensions = [str(scripts_folder / "custom_distribution_handler.py")]
my_model.extensions = os.path.join(scripts_folder, "custom_distribution_handler.py")

my_model.save(temp_dir.name)
my_model.load(temp_dir.name)
Expand Down Expand Up @@ -318,7 +318,7 @@
extensions_registry.clear()

# Reload to apply the extensions
my_model.extensions = [str(scripts_folder / "custom_reservoir_handler.py")]
my_model.extensions = os.path.join(scripts_folder, "custom_reservoir_handler.py")
my_model.save(temp_dir.name)
my_model.load(temp_dir.name)

Expand Down Expand Up @@ -405,7 +405,7 @@
# Again, we will add this extension to the model and reload it to apply the extension, verifying that the handler function has been applied and is working.
# %%
# Add the extension to the model
my_model.extensions.append(str(scripts_folder / "custom_fwtw_pull.py"))
my_model.extensions.append(os.path.join(scripts_folder, "custom_fwtw_pull.py"))

# Reload to apply the extensions
extensions_registry.clear()
Expand Down

0 comments on commit fd6efa9

Please sign in to comment.