From 0645e2a0bec247c6b1ed9983bce1f0bc1ea7601f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:04:27 +0000 Subject: [PATCH 1/3] Initial plan From bd1b2acaafba2520109cd02fb2f9b6fbcedcf107 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:06:28 +0000 Subject: [PATCH 2/3] Fix ImportError by replacing private typing members with public API Co-authored-by: rororowyourboat <48771381+rororowyourboat@users.noreply.github.com> --- src/math_spec_mapping/Load/type.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/math_spec_mapping/Load/type.py b/src/math_spec_mapping/Load/type.py index ddabf42..59cefea 100644 --- a/src/math_spec_mapping/Load/type.py +++ b/src/math_spec_mapping/Load/type.py @@ -1,7 +1,7 @@ from .general import check_json_keys from ..Classes import Type import os -from typing import _UnionGenericAlias, List, _GenericAlias +from typing import List, get_origin def convert_type(data, ms): @@ -34,9 +34,8 @@ def convert_type(data, ms): val = val.__name__ out[key] = val data["type_name"]["python"] = str(out) - elif type(data["type"]["python"]) == _UnionGenericAlias: - data["type_name"]["python"] = data["type"]["python"].__repr__() - elif type(data["type"]["python"]) == _GenericAlias: + elif get_origin(data["type"]["python"]) is not None: + # Handle generic types (Union, List, etc.) data["type_name"]["python"] = data["type"]["python"].__repr__() else: data["type_name"]["python"] = data["type"]["python"].__name__ From d5a0ad94bdde781494386db6177897e8d6d0414d Mon Sep 17 00:00:00 2001 From: Rohan Mehta Date: Thu, 22 Jan 2026 21:51:30 +0530 Subject: [PATCH 3/3] Update src/math_spec_mapping/Load/type.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/math_spec_mapping/Load/type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math_spec_mapping/Load/type.py b/src/math_spec_mapping/Load/type.py index 59cefea..783e100 100644 --- a/src/math_spec_mapping/Load/type.py +++ b/src/math_spec_mapping/Load/type.py @@ -1,7 +1,7 @@ from .general import check_json_keys from ..Classes import Type import os -from typing import List, get_origin +from typing import get_origin def convert_type(data, ms):