Skip to content

Commit ab710f4

Browse files
refactor(examples): remove LOAD_PATH modifications and use OptSet wrapper
This commit removes the manual LOAD_PATH modifications in tutorial files which are no longer needed when the package is properly installed. It also updates the examples to use the OptSet wrapper function and properly exports it in the public API. Additionally, it cleans up unnecessary dev dependencies in Project.toml.
1 parent 2abac75 commit ab710f4

6 files changed

Lines changed: 6 additions & 30 deletions

File tree

Project.toml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ DocStringExtensions = "0.9.3"
4747
EzXML = "1.2.0"
4848
ForceImport = "0.0.3"
4949
Gmsh = "0.3.1"
50-
HypertextLiteral = "0.9.5"
5150
JSON3 = "1.14.2"
5251
LinearAlgebra = "1.11.0"
5352
Logging = "1.11.0"
@@ -59,36 +58,14 @@ PlotlyJS = "0.18.15"
5958
Plots = "1.40.9"
6059
Printf = "1.11.0"
6160
Reexport = "1.2.2"
62-
Revise = "3.7.2"
6361
Serialization = "1.11.0"
6462
SpecialFunctions = "2.5.0"
6563
Statistics = "1.11.1"
6664

6765
[extras]
68-
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
69-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
70-
Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e"
7166
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
72-
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
73-
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
74-
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
75-
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
76-
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
77-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
78-
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
79-
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
80-
LocalRegistry = "89398ba2-070a-4b16-a995-9893c55d93cf"
81-
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
82-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
83-
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
84-
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
85-
ProfileView = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7"
86-
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
8767
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
88-
SymSpellChecker = "bb1b64e9-0ccc-445c-80cb-5313b9f7dfe1"
8968
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
90-
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
9169

9270
[targets]
93-
dev = ["ArgParse", "BenchmarkTools", "Infiltrator", "JET", "JuliaFormatter", "LocalRegistry", "ProfileView", "Revise", "SymSpellChecker", "TestItemRunner"]
94-
test = ["Test", "Coverage"]
71+
test = ["Test", "Coverage", "SafeTestsets"]

examples/525kV_1600mm2_bipole_export.pscx

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

examples/tutorial1.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Depth = 2:3
1919
# ## Getting started
2020

2121
# Load the package:
22-
push!(LOAD_PATH, joinpath(@__DIR__, "..", "src")) # hide
2322
using LineCableModels
2423

2524
#=

examples/tutorial2.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ This tutorial covers:
3434
=#
3535

3636
# Load the package and set up the environment:
37-
push!(LOAD_PATH, joinpath(@__DIR__, "..", "src")) # hide
3837
using DataFrames
3938
using LineCableModels
4039

examples/tutorial3.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ HVDC cables are constructed around a central conductor enclosed by a triple-extr
2525
=#
2626

2727
# Load the package and set up the environment:
28-
push!(LOAD_PATH, joinpath(@__DIR__, "..", "src")) # hide
2928
using DataFrames
3029
using LineCableModels
3130

@@ -358,7 +357,7 @@ formulation = FormulationSet(
358357
);
359358

360359
# Define runtime FEMOptions
361-
opts = FEMOptions(
360+
opts = OptSet(
362361
force_remesh=true, # Force remeshing
363362
force_overwrite=true, # Overwrite existing files
364363
plot_field_maps=false, # Do not compute/ plot field maps

src/interf.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Export public API
2-
export FormulationSet, to_df, add!
2+
export FormulationSet, OptSet, to_df, add!
33

44
"""
55
FormulationSet(...)
@@ -9,6 +9,8 @@ The system will infer the correct formulation type.
99
"""
1010
function FormulationSet end
1111

12+
function OptSet end
13+
1214
"""
1315
$(TYPEDSIGNATURES)
1416

0 commit comments

Comments
 (0)