jeremyomer / KidneyExchange.jl

MIT License
3 stars 2 forks source link

Error in examples/solve_with_bp.jl #23

Closed WPettersson closed 4 months ago

WPettersson commented 4 months ago

With latest master I get the following. I suspect the re-working of file IO has broken this example, but I'm also not sure what the intent of the latter part of this file.

If I comment out https://github.com/jeremyomer/KidneyExchange.jl/blob/e8fd74820acdbccf3f07348dce7bc183bf02f9e3/examples/solve_with_bp.jl#L43 and any of the lines at or following https://github.com/jeremyomer/KidneyExchange.jl/blob/e8fd74820acdbccf3f07348dce7bc183bf02f9e3/examples/solve_with_bp.jl#L50 the file seems to run again.

Error message:

% ~/opt/julia-1.10.1/bin/julia examples/solve_with_bp.jl
ERROR: LoadError: MethodError: no method matching read_wmd_file(::String)

Closest candidates are:
  read_wmd_file(::Any, ::Any)
   @ KidneyExchange ~/.julia/packages/KidneyExchange/07zMq/src/instance/matching_instance.jl:205

Stacktrace:
 [1] top-level scope
   @ ~/src/git/KidneyExchange.jl/examples/solve_with_bp.jl:43
in expression starting at /home/wpette/src/git/KidneyExchange.jl/examples/solve_with_bp.jl:43
pnavaro commented 4 months ago

Hi William, I had some explanation by the original authors of the package. They told me that the preflib file format changed during the developpement of the package and they did not want to upgrade it because their results in the paper were made with the old format. I tried to manage this new preflib format and keep the old behaviour for people who want to reproduce the paper simulations. That's why I created this example.

If you run julia with MD files in the working directory, it works. I fixed the path to these files in #24

pnavaro commented 4 months ago
$ julia --project examples/solve_with_bp.jl
  3.159530 seconds (3.00 M allocations: 196.175 MiB, 7.54% gc time, 99.63% compilation time: 4% of which was recompilation)
  0.005093 seconds (10.55 k allocations: 443.266 KiB)