Closed JunmiHu closed 1 week ago
Hi, sorry about that. I'll take a look now.
This is fixed in 07a34fef021, but I will keep the issue open until I add a test case to cover it.
The issue was a recent-ish change where all observables are now represented as DimArray
s. The get_observables
function had not been updated to correctly handle this.
Thank you for the quick reply!
Upon running the same commands as above, I now obtain the following error:
julia> include("run_ddm_inference_synthetic.jl")
WARNING: redefinition of constant Main.rng. This may fail, cause incorrect answers, or produce other errors.
1.417704 seconds (14.35 M allocations: 1.939 GiB, 4.97% gc time, 1.00% compilation time)
0.310802 seconds (9.18 M allocations: 768.920 MiB, 14.33% gc time, 0.99% compilation time)
2.399415 seconds (89.12 M allocations: 6.381 GiB, 10.73% gc time, 3.13% compilation time)
ERROR: LoadError: UndefVarError: `PySNE` not defined
Stacktrace:
[1] top-level scope
@ ./timing.jl:279
[2] include(fname::String)
@ Base.MainInclude ./client.jl:489
[3] top-level scope
@ REPL[2]:1
It isn't clear to me why the program isn't able to locate the PySNE function, but I have been unable to make it work in my own code as well. I'm quite new to Julia, so it is possible that there is some detail I have missed.
Also, I recognize that this can be considered to be a separate issue. If relevant, do you wish for me to create a separate issue for this?
Yes, that's not super well documented yet... sorry for the confusion.
The PySNE
type is only compiled/loaded when the PythonCall
package is available in the local environment. This is a soft dependency to avoid making this package too bloated for those who do not wish to use the python tools.
In this case, PythonCall
should be included as a dependency in the local environment for the example.
Try restarting julia from the root directory of the repository as:
julia --project=examples/ddm
Then run instantiate
again in the package manager.
The python dependencies should then be installed and the PySNE
type will be available.
Hi, thank you again for the quick response. I believe that I am doing this currently. To verify, I am running the following commands:
git clone git@github.com:bgroenks96/SimulationBasedInference.jl.git
cd SimulationBasedInference.jl
julia --project=examples/ddm
] instantiate
include("examples/ddm/run_ddm_inference_synthetic.jl")
include("examples/ddm/run_ddm_inference_synthetic.jl")
This yields the following stack trace:
julia> include("examples/ddm/run_ddm_inference_synthetic.jl")
WARNING: redefinition of constant Main.rng. This may fail, cause incorrect answers, or produce other errors.
1.499571 seconds (14.35 M allocations: 1.939 GiB, 4.78% gc time, 0.97% compilation time)
0.301549 seconds (9.18 M allocations: 768.927 MiB, 12.84% gc time, 0.97% compilation time)
2.448723 seconds (83.61 M allocations: 5.987 GiB, 16.92% gc time, 2.87% compilation time)
ERROR: LoadError: UndefVarError: `PySNE` not defined
Stacktrace:
[1] top-level scope
@ ./timing.jl:279
[2] include(fname::String)
@ Base.MainInclude ./client.jl:489
[3] top-level scope
@ REPL[4]:1
I believe the PythonCall installation is correct. For instance, in this Julia REPL, I can run:
julia> re = pyimport("re")
Python: <module 're' from '/Users/junmiaohu/sommerjobb2024/SimulationBasedInference.jl/examples/ddm/.CondaPkg/env/lib/python3.11/re/__init__.py'>
julia> x = pylist([1,2,3])
Python: [1, 2, 3]
I have also attached a minimum working example below, named testing.jl. I believe it is intended that the program below runs without any errors:
using PythonCall
using SimulationBasedInference
using SimulationBasedInference.PySBI
PySNE()
Calling the program twice yields:
julia> include("examples/ddm/testing.jl")
Matplotlib is building the font cache; this may take a moment.
┌ Warning: Error requiring `PythonCall` from `SimulationBasedInference`
│ exception =
│ LoadError: ReadOnlyMemoryError()
│ in expression starting at /Users/junmiaohu/sommerjobb2024/SimulationBasedInference.jl/ext/pysbi/PySBI.jl:1
└ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:51
ERROR: LoadError: UndefVarError: `PySNE` not defined
Stacktrace:
[1] top-level scope
@ ~/sommerjobb2024/SimulationBasedInference.jl/examples/ddm/testing.jl:5
[2] include(fname::String)
@ Base.MainInclude ./client.jl:489
[3] top-level scope
@ REPL[10]:1
in expression starting at #############
julia> include("examples/ddm/testing.jl")
ERROR: LoadError: UndefVarError: `PySNE` not defined
Stacktrace:
[1] top-level scope
@ ~/sommerjobb2024/SimulationBasedInference.jl/examples/ddm/testing.jl:5
[2] include(fname::String)
@ Base.MainInclude ./client.jl:489
[3] top-level scope
@ REPL[10]:1
Thank you for help so far! Let me know if you need any other information.
I am not able to reproduce the issue on Julia v.1.10.3. I will try upgrading and see if that changes anything.
It is worth noting that it's generally not advisable to include
a file more than once, although I would not expect it to produce such an error.
Please go ahead and create a separate issue for this.
Hi,
Something was wrong with my package installation of the repository in julia. I have now been able to run it without issue on Julia v.1.10.4. Apologies for the confusion, and thank you for your help!
Hi, I'd first like to thank you for taking the time to create this package. However, I did have problems running the ddm examples. I have documented the details for reproducing the errors below, but feel free to reach out if you were to need any further information.
Description run_ddm_inference_synthetic.jl returns an error: "LoadError: MethodError: no method matching isless(::Int64, ::DateTime)" upon calling the
get_observables
function insummarize_ensemble
.To Reproduce
Stack Trace The commands above yields the following result.
System info OS: MacOS 14.4.1 julia version: 1.10.4