From 1387ba3b718f1fb19ca3e9f742059447f3a409d6 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Tue, 24 Oct 2023 19:26:13 +0100 Subject: [PATCH 1/2] Better suggestion for putting .julia locally within the repo Using just '.' means the contents of '.julia' get put directly in the top level of the repo - really want to create a '.julia' subdirectory within the repo. --- machines/machine_setup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/machines/machine_setup.sh b/machines/machine_setup.sh index c9e5cf0da..7114848d9 100755 --- a/machines/machine_setup.sh +++ b/machines/machine_setup.sh @@ -203,10 +203,11 @@ echo JULIA_DIRECTORY=$JULIA_DEPOT_PATH echo "It can be useful or necessary to set a non-default location for the " echo ".julia directory. Leave this empty if the default location is OK." -echo "Enter the current directory '.' to isolate the julia used for this " -echo "instance of moment_kinetics - this might be useful to ensure a 'clean'" -echo "install or to check whether some error is related to conflicting or " -echo "corrupted dependencies or cached precompilation files, etc." +echo "Enter a name for a subdirectory of the current directory, e.g. " +echo "'.julia', to isolate the julia used for this instance of " +echo "moment_kinetics - this might be useful to ensure a 'clean' install or " +echo "to check whether some error is related to conflicting or corrupted " +echo "dependencies or cached precompilation files, etc." echo "Enter location that should be used for the .julia directory [$JULIA_DIRECTORY]:" # Use '-e' option to get path auto-completion read -e -p "> " input From 4549acf0336e5f2f11c17b32b935829c1eaf4e90 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Wed, 25 Oct 2023 12:51:31 +0100 Subject: [PATCH 2/2] Fix NetCDF array loading A recent update to NCDatasets.jl changed the behaviour of indexing like `var[:]` when loading a NetCDF variable. Now `var[:]` returns a 1d view. Fix by using `copy()` to convert the `NCDataset` to an `Array`. --- src/load_data.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/load_data.jl b/src/load_data.jl index 5507965b1..d6087c6f9 100644 --- a/src/load_data.jl +++ b/src/load_data.jl @@ -100,7 +100,7 @@ function load_variable(file_or_group::NCDataset, name::String) if size(file_or_group[name].var) == () var = file_or_group[name].var[] else - var = file_or_group[name].var[:] + var = copy(file_or_group[name].var) end if isa(var, Char) var = (var == Char(true))