Skip to content

Commit

Permalink
Update Antiq
Browse files Browse the repository at this point in the history
  • Loading branch information
ohno committed Nov 29, 2023
1 parent 3df57ba commit 2b9c806
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/Antiq.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
module Antiq

export antiq, InfinitePotentialWell, HarmonicOscillator, MorsePotential, HydrogenAtom
export antiq

include("./InfinitePotentialWell.jl")
include("./HarmonicOscillator.jl")
include("./MorsePotential.jl")
include("./HydrogenAtom.jl")
# Update this list when you add a model.
models = [
:InfinitePotentialWell,
:HarmonicOscillator,
:MorsePotential,
:HydrogenAtom,
]

# include statements
for model in models
include("./$(model).jl")
end

# I/O function
function save(path, text)
mkpath(dirname(path))
file = open(path, "w")
Base.write(file, text)
close(file)
end

# I/O function
function load(path)
file = open(path, "r")
text = Base.read(file, String)
close(file)
return text
end

# main functions
function antiq(model; parameters...)
# check existence of model
if model models
throw(ErrorException("\`:$(model)\` is not in the supported models $(models)."))
end
# load source code file
if Sys.iswindows()
source = load("$(dirname(@__FILE__()))\\\\$(model).jl")
Expand Down

0 comments on commit 2b9c806

Please sign in to comment.