Skip to content

Commit 6d0b5a7

Browse files
krisctlprabhakk-mw
authored andcommitted
MATLAB Kernel does not communicate with MATLAB through Jupyter Server.
fixes #77 fixes #55 fixes #48 fixes #41 fixes #30 fixes #27 fixes #24
1 parent 70d6dc1 commit 6d0b5a7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/jupyter_matlab_kernel/base_kernel.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2024 The MathWorks, Inc.
1+
# Copyright 2023-2025 The MathWorks, Inc.
22

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

7777

78-
def _get_parent_pid() -> str:
78+
def _get_parent_pid() -> int:
7979
"""
8080
Retrieves the parent process ID (PID) of the Kernel process.
8181

src/jupyter_matlab_kernel/kernel_factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The MathWorks, Inc.
1+
# Copyright 2024-2025 The MathWorks, Inc.
22

33
import os
44
from typing import Union
@@ -25,7 +25,7 @@ def _is_fallback_kernel_enabled():
2525
"""
2626

2727
# Get the env var toggle
28-
use_fallback_kernel = os.getenv("MWI_USE_FALLBACK_KERNEL", "TRUE")
28+
use_fallback_kernel = os.getenv("MWI_USE_FALLBACK_KERNEL", "FALSE")
2929
return use_fallback_kernel.lower().strip() == "true"
3030

3131
@staticmethod

src/jupyter_matlab_proxy/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020-2024 The MathWorks, Inc.
1+
# Copyright 2020-2025 The MathWorks, Inc.
22

33
import os
44
import secrets
@@ -15,7 +15,7 @@
1515
_MPM_AUTH_TOKEN: str = secrets.token_hex(32)
1616
_JUPYTER_SERVER_PID: str = str(os.getpid())
1717
_USE_FALLBACK_KERNEL: bool = (
18-
os.getenv("MWI_USE_FALLBACK_KERNEL", "TRUE").lower().strip() == "true"
18+
os.getenv("MWI_USE_FALLBACK_KERNEL", "FALSE").lower().strip() == "true"
1919
)
2020

2121

tests/unit/jupyter_matlab_kernel/test_kernel_factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The MathWorks, Inc.
1+
# Copyright 2024-2025 The MathWorks, Inc.
22

33
import pytest
44

@@ -47,4 +47,4 @@ def test_correct_kernel_type_is_returned_when_env_var_unset(monkeypatch):
4747
"""
4848
monkeypatch.delenv("MWI_USE_FALLBACK_KERNEL", raising=False)
4949
kernel_class = KernelFactory.get_kernel_class()
50-
assert kernel_class is MATLABKernelUsingJSP
50+
assert kernel_class is MATLABKernelUsingMPM

0 commit comments

Comments
 (0)