MrMustard icon indicating copy to clipboard operation
MrMustard copied to clipboard

use the juliacall package instead of julia

Open timmysilv opened this issue 9 months ago • 1 comments

Context: The julia python package is backed by PyCall, and PyCall kinda sucks. juliacall/pythoncall is a much easier package to work with, with very simple single-file configuration

Description of the Change: Replace uses of the julia python package with juliacall and do a bit of re-naming/tidying.

Benefits:

  • juliacall requires much less configuration up-front
  • if the required julia version from the config (~1.9.3 today) can't be found, it will automatically install a valid one at runtime using juliaup. Then, if the julia project hasn't been initialized (equivalent to the Pkg.instantiate("julia_pkg") thing we were doing before), it will do that automatically as well!
  • tl;dr the user need not do any real installation stuff anymore

Possible Drawbacks: I do not know if performance is worse. It might even be better? If a reviewer could help me prove this, that would be fantastic. That said, the creator of PyCall himself seems to like PythonCall

timmysilv avatar May 06 '24 17:05 timmysilv

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.43%. Comparing base (3afde75) to head (8517f2a).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #394      +/-   ##
===========================================
- Coverage    87.43%   87.43%   -0.01%     
===========================================
  Files           81       81              
  Lines         6137     6135       -2     
===========================================
- Hits          5366     5364       -2     
  Misses         771      771              
Files Coverage Δ
mrmustard/math/backend_numpy.py 100.00% <ø> (ø)
mrmustard/math/backend_tensorflow.py 100.00% <ø> (ø)
mrmustard/utils/settings.py 99.02% <100.00%> (-0.02%) :arrow_down:

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3afde75...8517f2a. Read the comment docs.

codecov[bot] avatar May 06 '24 20:05 codecov[bot]

I just added a hack to suppress the julia outputs that happen the first time you import it (in other words, the first time you increase the precision). If we don't mind the outputs happening in a fresh environment once, then I think we should revert that change. lmk what you think!

timmysilv avatar May 14 '24 21:05 timmysilv

confirmed offline, it's ok to have the output

timmysilv avatar May 15 '24 12:05 timmysilv