Skip to content

Commit 646f289

Browse files
style(earthprops): adjust exported symbols and formatting
1 parent d06529c commit 646f289

8 files changed

Lines changed: 57 additions & 376 deletions

examples/18kV_1000mm2_trifoil_export.pscx

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

examples/525kV_1600mm2_bipole_export.pscx

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

examples/cables_library.json

Lines changed: 1 addition & 306 deletions
Original file line numberDiff line numberDiff line change
@@ -1,311 +1,6 @@
11
{
22
"__julia_type__": "LineCableModels.DataModel.CablesLibrary",
3-
"cable_designs": {
4-
"18kV_1000mm2": {
5-
"cable_id": "18kV_1000mm2",
6-
"nominal_data": {
7-
"U": 30,
8-
"screen_cross_section": 35,
9-
"capacitance": 0.39,
10-
"__julia_type__": "LineCableModels.DataModel.NominalData",
11-
"U0": 18,
12-
"conductor_cross_section": 1000,
13-
"armor_cross_section": null,
14-
"resistance": 0.0291,
15-
"inductance": 0.3,
16-
"designation_code": "NA2XS(FL)2Y"
17-
},
18-
"__julia_type__": "LineCableModels.DataModel.CableDesign",
19-
"components": [
20-
{
21-
"insulator_group": {
22-
"__julia_type__": "LineCableModels.DataModel.InsulatorGroup",
23-
"layers": [
24-
{
25-
"material_props": {
26-
"T0": 20,
27-
"alpha": 0,
28-
"__julia_type__": "LineCableModels.Materials.Material",
29-
"eps_r": 32.3,
30-
"mu_r": 1,
31-
"rho": 5300
32-
},
33-
"radius_in": 0.02115,
34-
"__julia_type__": "LineCableModels.DataModel.Semicon",
35-
"radius_ext": 0.02145,
36-
"temperature": 20
37-
},
38-
{
39-
"material_props": {
40-
"T0": 20,
41-
"alpha": 0,
42-
"__julia_type__": "LineCableModels.Materials.Material",
43-
"eps_r": 1000,
44-
"mu_r": 1,
45-
"rho": 1000
46-
},
47-
"radius_in": 0.02145,
48-
"__julia_type__": "LineCableModels.DataModel.Semicon",
49-
"radius_ext": 0.02205,
50-
"temperature": 20
51-
},
52-
{
53-
"material_props": {
54-
"T0": 20,
55-
"alpha": 0,
56-
"__julia_type__": "LineCableModels.Materials.Material",
57-
"eps_r": 2.3,
58-
"mu_r": 1,
59-
"rho": 197000000000000
60-
},
61-
"radius_in": 0.02205,
62-
"__julia_type__": "LineCableModels.DataModel.Insulator",
63-
"radius_ext": 0.03005,
64-
"temperature": 20
65-
},
66-
{
67-
"material_props": {
68-
"T0": 20,
69-
"alpha": 0,
70-
"__julia_type__": "LineCableModels.Materials.Material",
71-
"eps_r": 1000,
72-
"mu_r": 1,
73-
"rho": 500
74-
},
75-
"radius_in": 0.03005,
76-
"__julia_type__": "LineCableModels.DataModel.Semicon",
77-
"radius_ext": 0.030350000000000002,
78-
"temperature": 20
79-
},
80-
{
81-
"material_props": {
82-
"T0": 20,
83-
"alpha": 0,
84-
"__julia_type__": "LineCableModels.Materials.Material",
85-
"eps_r": 32.3,
86-
"mu_r": 1,
87-
"rho": 5300
88-
},
89-
"radius_in": 0.030350000000000002,
90-
"__julia_type__": "LineCableModels.DataModel.Semicon",
91-
"radius_ext": 0.030650000000000004,
92-
"temperature": 20
93-
}
94-
]
95-
},
96-
"__julia_type__": "LineCableModels.DataModel.CableComponent",
97-
"id": "core",
98-
"conductor_group": {
99-
"__julia_type__": "LineCableModels.DataModel.ConductorGroup",
100-
"layers": [
101-
{
102-
"lay_ratio": 0,
103-
"material_props": {
104-
"T0": 20,
105-
"alpha": 0.00429,
106-
"__julia_type__": "LineCableModels.Materials.Material",
107-
"eps_r": 1,
108-
"mu_r": 1.000022,
109-
"rho": 2.8264e-8
110-
},
111-
"lay_direction": 1,
112-
"radius_in": 0,
113-
"__julia_type__": "LineCableModels.DataModel.WireArray",
114-
"radius_wire": 0.00235,
115-
"num_wires": 1,
116-
"temperature": 20
117-
},
118-
{
119-
"lay_ratio": 15,
120-
"material_props": {
121-
"T0": 20,
122-
"alpha": 0.00429,
123-
"__julia_type__": "LineCableModels.Materials.Material",
124-
"eps_r": 1,
125-
"mu_r": 1.000022,
126-
"rho": 2.8264e-8
127-
},
128-
"lay_direction": 1,
129-
"radius_in": 0.00235,
130-
"__julia_type__": "LineCableModels.DataModel.WireArray",
131-
"radius_wire": 0.00235,
132-
"num_wires": 6,
133-
"temperature": 20
134-
},
135-
{
136-
"lay_ratio": 13.5,
137-
"material_props": {
138-
"T0": 20,
139-
"alpha": 0.00429,
140-
"__julia_type__": "LineCableModels.Materials.Material",
141-
"eps_r": 1,
142-
"mu_r": 1.000022,
143-
"rho": 2.8264e-8
144-
},
145-
"lay_direction": 1,
146-
"radius_in": 0.007050000000000001,
147-
"__julia_type__": "LineCableModels.DataModel.WireArray",
148-
"radius_wire": 0.00235,
149-
"num_wires": 12,
150-
"temperature": 20
151-
},
152-
{
153-
"lay_ratio": 12.5,
154-
"material_props": {
155-
"T0": 20,
156-
"alpha": 0.00429,
157-
"__julia_type__": "LineCableModels.Materials.Material",
158-
"eps_r": 1,
159-
"mu_r": 1.000022,
160-
"rho": 2.8264e-8
161-
},
162-
"lay_direction": 1,
163-
"radius_in": 0.01175,
164-
"__julia_type__": "LineCableModels.DataModel.WireArray",
165-
"radius_wire": 0.00235,
166-
"num_wires": 18,
167-
"temperature": 20
168-
},
169-
{
170-
"lay_ratio": 11,
171-
"material_props": {
172-
"T0": 20,
173-
"alpha": 0.00429,
174-
"__julia_type__": "LineCableModels.Materials.Material",
175-
"eps_r": 1,
176-
"mu_r": 1.000022,
177-
"rho": 2.8264e-8
178-
},
179-
"lay_direction": 1,
180-
"radius_in": 0.01645,
181-
"__julia_type__": "LineCableModels.DataModel.WireArray",
182-
"radius_wire": 0.00235,
183-
"num_wires": 24,
184-
"temperature": 20
185-
}
186-
]
187-
}
188-
},
189-
{
190-
"insulator_group": {
191-
"__julia_type__": "LineCableModels.DataModel.InsulatorGroup",
192-
"layers": [
193-
{
194-
"material_props": {
195-
"T0": 20,
196-
"alpha": 0,
197-
"__julia_type__": "LineCableModels.Materials.Material",
198-
"eps_r": 32.3,
199-
"mu_r": 1,
200-
"rho": 5300
201-
},
202-
"radius_in": 0.031700000000000006,
203-
"__julia_type__": "LineCableModels.DataModel.Semicon",
204-
"radius_ext": 0.03200000000000001,
205-
"temperature": 20
206-
}
207-
]
208-
},
209-
"__julia_type__": "LineCableModels.DataModel.CableComponent",
210-
"id": "sheath",
211-
"conductor_group": {
212-
"__julia_type__": "LineCableModels.DataModel.ConductorGroup",
213-
"layers": [
214-
{
215-
"lay_ratio": 10,
216-
"material_props": {
217-
"T0": 20,
218-
"alpha": 0.00393,
219-
"__julia_type__": "LineCableModels.Materials.Material",
220-
"eps_r": 1,
221-
"mu_r": 0.999994,
222-
"rho": 1.7241e-8
223-
},
224-
"lay_direction": 1,
225-
"radius_in": 0.030650000000000004,
226-
"__julia_type__": "LineCableModels.DataModel.WireArray",
227-
"radius_wire": 0.000475,
228-
"num_wires": 49,
229-
"temperature": 20
230-
},
231-
{
232-
"lay_ratio": 10,
233-
"material_props": {
234-
"T0": 20,
235-
"alpha": 0.00393,
236-
"__julia_type__": "LineCableModels.Materials.Material",
237-
"eps_r": 1,
238-
"mu_r": 0.999994,
239-
"rho": 1.7241e-8
240-
},
241-
"lay_direction": 1,
242-
"radius_in": 0.0316,
243-
"__julia_type__": "LineCableModels.DataModel.Strip",
244-
"width": 0.01,
245-
"radius_ext": 0.031700000000000006,
246-
"temperature": 20
247-
}
248-
]
249-
}
250-
},
251-
{
252-
"insulator_group": {
253-
"__julia_type__": "LineCableModels.DataModel.InsulatorGroup",
254-
"layers": [
255-
{
256-
"material_props": {
257-
"T0": 20,
258-
"alpha": 0,
259-
"__julia_type__": "LineCableModels.Materials.Material",
260-
"eps_r": 2.3,
261-
"mu_r": 1,
262-
"rho": 197000000000000
263-
},
264-
"radius_in": 0.032150000000000005,
265-
"__julia_type__": "LineCableModels.DataModel.Insulator",
266-
"radius_ext": 0.032200000000000006,
267-
"temperature": 20
268-
},
269-
{
270-
"material_props": {
271-
"T0": 20,
272-
"alpha": 0,
273-
"__julia_type__": "LineCableModels.Materials.Material",
274-
"eps_r": 2.3,
275-
"mu_r": 1,
276-
"rho": 197000000000000
277-
},
278-
"radius_in": 0.032200000000000006,
279-
"__julia_type__": "LineCableModels.DataModel.Insulator",
280-
"radius_ext": 0.034600000000000006,
281-
"temperature": 20
282-
}
283-
]
284-
},
285-
"__julia_type__": "LineCableModels.DataModel.CableComponent",
286-
"id": "jacket",
287-
"conductor_group": {
288-
"__julia_type__": "LineCableModels.DataModel.ConductorGroup",
289-
"layers": [
290-
{
291-
"material_props": {
292-
"T0": 20,
293-
"alpha": 0.00429,
294-
"__julia_type__": "LineCableModels.Materials.Material",
295-
"eps_r": 1,
296-
"mu_r": 1.000022,
297-
"rho": 2.8264e-8
298-
},
299-
"radius_in": 0.03200000000000001,
300-
"__julia_type__": "LineCableModels.DataModel.Tubular",
301-
"radius_ext": 0.032150000000000005,
302-
"temperature": 20
303-
}
304-
]
305-
}
306-
}
307-
]
308-
},
3+
"data": {
3094
"525kV_1600mm2": {
3105
"cable_id": "525kV_1600mm2",
3116
"nominal_data": {

examples/tutorial1.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Depth = 2:3
1616
```
1717
=#
1818

19-
# ## Getting started
19+
### Getting started
20+
21+
fullfile(filename) = joinpath(@__DIR__, filename) # hide
2022

2123
# Load the package:
2224
using DataFrames
@@ -88,10 +90,10 @@ delete!(materials, "epr_dupe")
8890

8991
# Examine the updated library after removing the duplicate:
9092
println("Material properties compiled from CIGRE TB-531 and IEC 60287:")
91-
materials_df = DataFrame(materials)
93+
display(DataFrame(materials))
9294

9395
# ## Saving the materials library to JSON
94-
output_file = joinpath(@__DIR__, "materials_library.json")
96+
output_file = fullfile("materials_library.json")
9597
save(materials, file_name=output_file);
9698

9799

@@ -109,7 +111,7 @@ load!(materials_from_json, file_name=output_file)
109111
copper = get(materials_from_json, "copper_corrected")
110112

111113
# Access the material properties:
112-
println("\nRetrieved copper_corrected material properties:")
114+
println("Retrieved copper_corrected material properties:")
113115
println("Resistivity: $(copper.rho) Ω·m")
114116
println("Relative permittivity: $(copper.eps_r)")
115117
println("Relative permeability: $(copper.mu_r)")

examples/tutorial2.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ This tutorial covers:
3333
## Getting started
3434
=#
3535

36+
fullfile(filename) = joinpath(@__DIR__, filename) # hide
37+
3638
# Load the package and set up the environment:
3739
using DataFrames
3840
using LineCableModels
@@ -360,7 +362,7 @@ add!(library, cable_design)
360362
library_df = DataFrame(library)
361363

362364
# Save to file for later use:
363-
output_file = joinpath(@__DIR__, "cables_library.json")
365+
output_file = fullfile("cables_library.json")
364366
save(library, file_name=output_file);
365367

366368

@@ -394,7 +396,7 @@ This section ilustrates the construction of a cable system with three identical
394396
# Define system center point (underground at 1 m depth) and the trifoil positions
395397
x0 = 0
396398
y0 = -1
397-
xa, ya, xb, yb, xc, yc = trifoil_formation(x0, y0, 0.035)
399+
xa, ya, xb, yb, xc, yc = trifoil_formation(x0, y0, 0.035);
398400

399401
# Initialize the `LineCableSystem` with the first cable (phase A):
400402
cablepos = CablePosition(cable_design, xa, ya,
@@ -403,12 +405,9 @@ cable_system = LineCableSystem("18kV_1000mm2_trifoil", 1000.0, cablepos)
403405

404406
# Add remaining cables (phases B and C):
405407
add!(cable_system, cable_design, xb, yb,
406-
Dict("core" => 2, "sheath" => 0, "jacket" => 0),
407-
)
408-
add!(
409-
cable_system, cable_design, xc, yc,
410-
Dict("core" => 3, "sheath" => 0, "jacket" => 0),
411-
)
408+
Dict("core" => 2, "sheath" => 0, "jacket" => 0))
409+
add!(cable_system, cable_design, xc, yc,
410+
Dict("core" => 3, "sheath" => 0, "jacket" => 0))
412411

413412
#=
414413
!!! note "Phase mapping"
@@ -434,7 +433,7 @@ The final step showcases how to export the model for electromagnetic transient s
434433
=#
435434

436435
# Export to PSCAD input file:
437-
output_file = joinpath(@__DIR__, "$(cable_system.system_id)_export.pscx")
436+
output_file = fullfile("$(cable_system.system_id)_export.pscx")
438437
export_file = export_data(:pscad, cable_system, earth_params, file_name=output_file);
439438

440439
#=

0 commit comments

Comments
 (0)