Skip to content

Commit

Permalink
doc: Move example outputs to tmpdir
Browse files Browse the repository at this point in the history
Currently running the examples (and tests that include them) generates
data in the working directory.  Move this to temporary directories that
are cleaned up automatically on exit.
  • Loading branch information
musoke committed Jun 25, 2024
1 parent 76da65e commit b7d0e9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/2d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"metadata": {},
"outputs": [],
"source": [
"output_dir = joinpath(pwd(), \"output\", \"2D\")\n",
"output_dir = joinpath(mktempdir(), \"output\", \"2D\")\n",
"\n",
"output_times = 0:0.1:5\n",
"output_config = OutputConfig(output_dir, output_times);"
Expand Down
2 changes: 1 addition & 1 deletion examples/growth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@
}
],
"source": [
"output_dir = \"$(pwd())/output\"\n",
"output_dir = joinpath(mktempdir(), \"output\")\n",
"num_saves = 100\n",
"\n",
"output_a = exp10.(range(log10(a_init), log10(a_final), num_saves))\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/soliton_velocity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const velocity = [1, 0, 0]
const phase = 0
const t0 = 0

const output_dir = "output/vel/centered_on_soliton"
const output_dir = joinpath(mktempdir(), "output/vel/centered_on_soliton")

function run_sim()

Expand Down

0 comments on commit b7d0e9b

Please sign in to comment.