I am working on my first package (a basic charge simulator for electrical engineering). The code is broken up into a handful of small functions. There is no need to make those functions available so I wrap them all in an outer function which is exported in the module. Like this:
Module
using StaticArrays
using FFTW
using LinearAlgebra
export csm
function csm(input1,input2,...,input10)
function func1(input1)
#stuff
end
function func2(input2,input3)
#stuff
end
#...more functions...
function func7(input10)
#stuff
end
return result1, result2, result3
end
end
Presently, the inputs to the outer function are a bit unwieldy
The 10 inputs consist of a couple of constants and arrays of varying length. Some of the arrays are arrays of coordinates defined using StaticArrays.jl (i.e. SVectors).
A function call looks like this:
uniformChargeDensity, nonuniformChargeDensity, chargeValues, zArray =
csm(subconductorAxisCoordinates, subconductorSurfaceCoordinates, subconductorVoltages, baseChargeCoordinates, matchPointCoordinates, matchPointVoltages,
,arcChargeCoordinates, arcMatchCoordinates, N, γRange)
Calls to this function are iterative, but only two of the inputs change between iterations. An external function will initially read in a text file to populate the variables that do not change between iterations. Do you have a suggestion for the most Julian way to organize these inputs?
I did see this thread: Functions with many arguments, but wasn’t sure if that is the right solution for this iterative situation.