Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx readthedocs notebook wont execute #95

Closed
aaronspring opened this issue May 3, 2022 · 1 comment · Fixed by #153 or #167
Closed

sphinx readthedocs notebook wont execute #95

aaronspring opened this issue May 3, 2022 · 1 comment · Fixed by #153 or #167
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@aaronspring
Copy link
Collaborator

aaronspring commented May 3, 2022

Description

What happens

---------------------------------------------------------------------------
JuliaError                                Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import xbitinfo as xb
      3 import xarray as xr
      5 xr.set_options(display_style="text")

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/94/xbitinfo/__init__.py:4, in <module>
      1 """Top-level package for xbitinfo."""
      3 from ._version import __version__
----> 4 from .bitround import jl_bitround, xr_bitround
      5 from .graphics import plot_bitinformation, plot_distribution
      6 from .save_compressed import get_compress_encoding_nc, get_compress_encoding_zarr

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/94/xbitinfo/bitround.py:4, in <module>
      1 import xarray as xr
      2 from numcodecs.bitround import BitRound
----> 4 from .xbitinfo import _jl_bitround, get_keepbits
      7 def _np_bitround(data, keepbits):
      8     """Bitround for Arrays."""

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/94/xbitinfo/xbitinfo.py:19, in <module>
     15 path_to_julia_functions = os.path.join(
     16     os.path.dirname(__file__), "bitinformation_wrapper.jl"
     17 )
     18 Main.path = path_to_julia_functions
---> 19 jl.using("BitInformation")
     20 jl.using("Pkg")
     21 jl.eval("include(Main.path)")

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/lib/python3.9/site-packages/julia/core.py:644, in Julia.using(self, module)
    642 def using(self, module):
    643     """Load module in Julia by calling the `using module` command"""
--> 644     self.eval("using %s" % module)

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/lib/python3.9/site-packages/julia/core.py:621, in Julia.eval(self, src)
    619 if src is None:
    620     return None
--> 621 ans = self._call(src)
    622 if not ans:
    623     return None

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/lib/python3.9/site-packages/julia/core.py:549, in Julia._call(self, src)
    547 # logger.debug("_call(%s)", src)
    548 ans = self.api.jl_eval_string(src.encode('utf-8'))
--> 549 self.check_exception(src)
    551 return ans

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/lib/python3.9/site-packages/julia/core.py:603, in Julia.check_exception(self, src)
    601 else:
    602     exception = sprint(showerror, self._as_pyobj(res))
--> 603 raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
    604                  .format(exception, src))

JuliaError: Exception 'LoadError: InterruptException:
in expression starting at /home/docs/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/share/julia/packages/Distributions/0h6GE/src/multivariate/mvnormal.jl:415
in expression starting at /home/docs/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/share/julia/packages/Distributions/0h6GE/src/multivariates.jl:112
in expression starting at /home/docs/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/share/julia/packages/Distributions/0h6GE/src/Distributions.jl:1
in expression starting at /home/docs/checkouts/readthedocs.org/user_builds/xbitinfo/conda/94/share/julia/packages/BitInformation/VpaaY/src/BitInformation.jl:1' occurred while calling julia code:
using BitInformation

on RTD: https://readthedocs.org/projects/xbitinfo/builds/16814564/

but works locally!

I guess the julia installer doesnt install into the right kernel or I choose the wrong kernel.
Also cannot get nbsphinx_kernel_name = "bitinfo-docs" working in conf.py

@aaronspring aaronspring added documentation Improvements or additions to documentation help wanted Extra attention is needed labels May 3, 2022
@aaronspring
Copy link
Collaborator Author

---------------------------------------------------------------------------
JuliaError                                Traceback (most recent call last)
Cell In [1], line 1
----> 1 import xbitinfo as xb
      3 import xarray as xr
      5 xr.set_options(display_style="text")

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/138/xbitinfo/__init__.py:8
      5 except ImportError:
      6     __version__ = "unknown"
----> 8 from .bitround import jl_bitround, xr_bitround
      9 from .graphics import plot_bitinformation, plot_distribution
     10 from .save_compressed import get_compress_encoding_nc, get_compress_encoding_zarr

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/138/xbitinfo/bitround.py:4
      1 import xarray as xr
      2 from numcodecs.bitround import BitRound
----> 4 from .xbitinfo import _jl_bitround, get_keepbits
      7 def _np_bitround(data, keepbits):
      8     """Bitround for Arrays."""

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/138/xbitinfo/xbitinfo.py:15
     13 already_ran = False
     14 if not already_ran:
---> 15     already_ran = install(quiet=True)
     18 jl = Julia(compiled_modules=False, debug=True)
     19 from julia import Main  # noqa: E402

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/138/xbitinfo/julia_helpers.py:38, in install(julia_project, quiet)
     34 Main.eval(
     35     f'Pkg.activate("{_escape_filename(julia_project)}", shared = Bool({int(is_shared)}), {io_arg})'
     36 )
     37 if is_shared:
---> 38     _add_to_julia_project(Main, io_arg)
     40 Main.eval(f"Pkg.instantiate({io_arg})")
     41 Main.eval(f"Pkg.precompile({io_arg})")

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/checkouts/138/xbitinfo/julia_helpers.py:123, in _add_to_julia_project(Main, io_arg)
    113 Main.bitinformation_spec = Main.PackageSpec(
    114     name="BitInformation",
    115     url="https://github.com/milankl/BitInformation.jl",
    116     rev="v0.6.0",
    117 )
    118 Main.statsbase_spec = Main.PackageSpec(
    119     name="StatsBase",
    120     url="https://github.com/JuliaStats/StatsBase.jl",
    121     rev="v0.33.21",
    122 )
--> 123 Main.eval(f"Pkg.add([bitinformation_spec, statsbase_spec], {io_arg})")

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/138/lib/python3.9/site-packages/julia/core.py:621, in Julia.eval(self, src)
    619 if src is None:
    620     return None
--> 621 ans = self._call(src)
    622 if not ans:
    623     return None

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/138/lib/python3.9/site-packages/julia/core.py:549, in Julia._call(self, src)
    547 # logger.debug("_call(%s)", src)
    548 ans = self.api.jl_eval_string(src.encode('utf-8'))
--> 549 self.check_exception(src)
    551 return ans

File ~/checkouts/readthedocs.org/user_builds/xbitinfo/conda/138/lib/python3.9/site-packages/julia/core.py:603, in Julia.check_exception(self, src)
    601 else:
    602     exception = sprint(showerror, self._as_pyobj(res))
--> 603 raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
    604                  .format(exception, src))

JuliaError: Exception 'InterruptException:' occurred while calling julia code:
Pkg.add([bitinformation_spec, statsbase_spec], io=devnull)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
1 participant