Skip to content

Commit 523bea2

Browse files
Refactor type hints to use pathlib.Path instead of Path for consistency
1 parent 54b7234 commit 523bea2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

imas/db_entry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import logging
88
import os
9-
from pathlib import Path
9+
import pathlib
1010
from typing import Any, Type, overload
1111

1212
import numpy
@@ -78,7 +78,7 @@ def __init__(
7878
mode: str,
7979
*,
8080
dd_version: str | None = None,
81-
xml_path: str | Path | None = None,
81+
xml_path: str | pathlib.Path | None = None,
8282
) -> None: ...
8383

8484
@overload
@@ -93,14 +93,14 @@ def __init__(
9393
*,
9494
shot: int | None = None,
9595
dd_version: str | None = None,
96-
xml_path: str | Path | None = None,
96+
xml_path: str | pathlib.Path | None = None,
9797
) -> None: ...
9898

9999
def __init__(
100100
self,
101101
*args,
102102
dd_version: str | None = None,
103-
xml_path: str | Path | None = None,
103+
xml_path: str | pathlib.Path | None = None,
104104
**kwargs,
105105
):
106106
"""Open or create a Data Entry based on the provided URI and mode, or prepare a

imas/ids_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from __future__ import annotations
66

77
import logging
8+
import pathlib
89
from collections.abc import Iterable, Iterator
910
from functools import partial
10-
from pathlib import Path
1111
from typing import Any
1212

1313
from imas import dd_zip
@@ -30,7 +30,7 @@ class IDSFactory:
3030
"""
3131

3232
def __init__(
33-
self, version: str | None = None, xml_path: str | Path | None = None
33+
self, version: str | None = None, xml_path: str | pathlib.Path | None = None
3434
) -> None:
3535
"""Create a new IDS Factory
3636

0 commit comments

Comments
 (0)