Skip to content

Commit

Permalink
MATLAB Kernel does not communicate with MATLAB through Jupyter Server.
Browse files Browse the repository at this point in the history
fixes #77
fixes #55
fixes #48
fixes #41
fixes #30
fixes #27
fixes #24
  • Loading branch information
Krishan Sharma authored and prabhakk-mw committed Jan 7, 2025
1 parent 70d6dc1 commit 6d0b5a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/jupyter_matlab_kernel/base_kernel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023-2024 The MathWorks, Inc.
# Copyright 2023-2025 The MathWorks, Inc.

"""
This module serves as the base class for various MATLAB Kernels.
Expand Down Expand Up @@ -72,10 +72,10 @@ def _fetch_jupyter_base_url(parent_pid: str, logger: Logger) -> Optional[str]:
logger.debug(
"Jupyter server associated with this MATLAB Kernel not found, might a non-jupyter based MATLAB Kernel"
)
return None
return None


def _get_parent_pid() -> str:
def _get_parent_pid() -> int:
"""
Retrieves the parent process ID (PID) of the Kernel process.
Expand Down
4 changes: 2 additions & 2 deletions src/jupyter_matlab_kernel/kernel_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 The MathWorks, Inc.
# Copyright 2024-2025 The MathWorks, Inc.

import os
from typing import Union
Expand All @@ -25,7 +25,7 @@ def _is_fallback_kernel_enabled():
"""

# Get the env var toggle
use_fallback_kernel = os.getenv("MWI_USE_FALLBACK_KERNEL", "TRUE")
use_fallback_kernel = os.getenv("MWI_USE_FALLBACK_KERNEL", "FALSE")
return use_fallback_kernel.lower().strip() == "true"

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions src/jupyter_matlab_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2024 The MathWorks, Inc.
# Copyright 2020-2025 The MathWorks, Inc.

import os
import secrets
Expand All @@ -15,7 +15,7 @@
_MPM_AUTH_TOKEN: str = secrets.token_hex(32)
_JUPYTER_SERVER_PID: str = str(os.getpid())
_USE_FALLBACK_KERNEL: bool = (
os.getenv("MWI_USE_FALLBACK_KERNEL", "TRUE").lower().strip() == "true"
os.getenv("MWI_USE_FALLBACK_KERNEL", "FALSE").lower().strip() == "true"
)


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/jupyter_matlab_kernel/test_kernel_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 The MathWorks, Inc.
# Copyright 2024-2025 The MathWorks, Inc.

import pytest

Expand Down Expand Up @@ -47,4 +47,4 @@ def test_correct_kernel_type_is_returned_when_env_var_unset(monkeypatch):
"""
monkeypatch.delenv("MWI_USE_FALLBACK_KERNEL", raising=False)
kernel_class = KernelFactory.get_kernel_class()
assert kernel_class is MATLABKernelUsingJSP
assert kernel_class is MATLABKernelUsingMPM

0 comments on commit 6d0b5a7

Please sign in to comment.