Skip to content

Commit cb0ba83

Browse files
author
Lisa Glover
committed
Updated the file paths in the code to work cross-platform
1 parent 0f14714 commit cb0ba83

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

scripting/monte_carlo/demo_01_r_of_rho_simple.ipynb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"#Import the Operating System so we can access the files for the VTS library\n",
2626
"import os\n",
2727
"current_directory = os.getcwd()\n",
28-
"publish_local = current_directory.replace(\"monte_carlo\", \"libraries\\Vts.dll\")"
28+
"library_directory = current_directory.replace(\"monte_carlo\", \"libraries\")\n",
29+
"vts_path = os.path.join(library_directory, \"Vts.dll\")"
2930
]
3031
},
3132
{
@@ -62,7 +63,7 @@
6263
"from pythonnet import set_runtime\n",
6364
"set_runtime(\"coreclr\")\n",
6465
"import clr\n",
65-
"clr.AddReference(publish_local)\n",
66+
"clr.AddReference(vts_path)\n",
6667
"import numpy as np\n",
6768
"import plotly.graph_objects as go\n",
6869
"import plotly.express as px\n",
@@ -131,13 +132,6 @@
131132
"chart.update_yaxes(type=\"log\")\n",
132133
"chart.show()\n"
133134
]
134-
},
135-
{
136-
"cell_type": "code",
137-
"execution_count": null,
138-
"metadata": {},
139-
"outputs": [],
140-
"source": []
141135
}
142136
],
143137
"metadata": {

scripting/monte_carlo/demo_02_DAW_vs_CAW.ipynb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"#Import the Operating System so we can access the files for the VTS library\n",
2828
"import os\n",
2929
"current_directory = os.getcwd()\n",
30-
"publish_local = current_directory.replace(\"monte_carlo\", \"libraries\\Vts.dll\")"
30+
"library_directory = current_directory.replace(\"monte_carlo\", \"libraries\")\n",
31+
"vts_path = os.path.join(library_directory, \"Vts.dll\")"
3132
]
3233
},
3334
{
@@ -68,7 +69,7 @@
6869
"from pythonnet import set_runtime\n",
6970
"set_runtime(\"coreclr\")\n",
7071
"import clr\n",
71-
"clr.AddReference(publish_local)\n",
72+
"clr.AddReference(vts_path)\n",
7273
"import numpy as np\n",
7374
"import plotly.graph_objects as go\n",
7475
"import plotly.express as px\n",
@@ -161,14 +162,6 @@
161162
"chart.update_yaxes(type=\"log\")\n",
162163
"chart.show()"
163164
]
164-
},
165-
{
166-
"cell_type": "code",
167-
"execution_count": null,
168-
"id": "c4ec7f86",
169-
"metadata": {},
170-
"outputs": [],
171-
"source": []
172165
}
173166
],
174167
"metadata": {

scripting/monte_carlo/vts-trial.ipynb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
"\n",
1616
"* [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) has been installed\n",
1717
"\n",
18-
"* [VTS git repository](https://github.com/VirtualPhotonics/VTS) has been cloned\n",
19-
"\n",
2018
"* [pythonnet](https://pypi.org/project/pythonnet) has been installed and configured\n",
2119
"\n",
22-
"Replace `/path/to/vts` with the directory containing the git clone of `VTS`"
20+
"* The latest [VTS libraries](https://github.com/VirtualPhotonics/Vts.Scripting.Python/releases) have been downloaded from the zip file in releases and extracted to the libraries folder"
2321
]
2422
},
2523
{
@@ -36,7 +34,12 @@
3634
"import numpy as np\n",
3735
"import matplotlib.pyplot as plt\n",
3836
"\n",
39-
"clr.AddReference(\"/path/to/vts/publish/local/Vts.dll\")"
37+
"#Import the Operating System so we can get the file path for the Vts library\n",
38+
"import os\n",
39+
"current_directory = os.getcwd()\n",
40+
"library_directory = current_directory.replace(\"monte_carlo\", \"libraries\")\n",
41+
"vts_path = os.path.join(library_directory, \"Vts.dll\")\n",
42+
"clr.AddReference(vts_path)"
4043
]
4144
},
4245
{
@@ -277,7 +280,7 @@
277280
"name": "python",
278281
"nbconvert_exporter": "python",
279282
"pygments_lexer": "ipython3",
280-
"version": "3.12.3"
283+
"version": "3.11.5"
281284
}
282285
},
283286
"nbformat": 4,

0 commit comments

Comments
 (0)