File tree 4 files changed +8
-4
lines changed
src/linkml_arrays/dumpers
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4
4
from abc import ABCMeta , abstractmethod
5
5
from collections .abc import Callable
6
6
from pathlib import Path
7
- from typing import List , Union
7
+ from typing import List , Optional , Union
8
8
9
9
import numpy as np
10
10
import yaml
@@ -88,7 +88,7 @@ def dumps(
88
88
self ,
89
89
element : Union [YAMLRoot , BaseModel ],
90
90
schemaview : SchemaView ,
91
- output_dir : Union [str , Path ] = None ,
91
+ output_dir : Optional [ Union [str , Path ] ] = None ,
92
92
** kwargs ,
93
93
) -> str :
94
94
"""Return element formatted as a YAML string."""
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ def write_array(
24
24
"""Write an array to an HDF5 file."""
25
25
# TODO do not assume that there is only one by this name
26
26
# add suffix to the file name
27
+ if isinstance (output_file_path_no_suffix , str ):
28
+ output_file_path_no_suffix = Path (output_file_path_no_suffix )
27
29
output_file_path = output_file_path_no_suffix .parent / (
28
30
output_file_path_no_suffix .name + cls .FILE_SUFFIX
29
31
)
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ def write_array(
23
23
"""Write an array to a NumPy file."""
24
24
# TODO do not assume that there is only one by this name
25
25
# add suffix to the file name
26
+ if isinstance (output_file_path_no_suffix , str ):
27
+ output_file_path_no_suffix = Path (output_file_path_no_suffix )
26
28
output_file_path = output_file_path_no_suffix .parent / (
27
29
output_file_path_no_suffix .name + cls .FILE_SUFFIX
28
30
)
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ envlist =
15
15
lint
16
16
flake8
17
17
mypy
18
- docstr-coverage
18
+ ; docstr-coverage
19
19
py
20
20
21
21
[testenv]
@@ -100,4 +100,4 @@ deps =
100
100
docstr-coverage
101
101
commands =
102
102
docstr-coverage src/ tests/ --skip-private --skip-magic
103
- description = Run the docstr-coverage tool to check documentation coverage
103
+ description = Run the docstr-coverage tool to check documentation coverage
You can’t perform that action at this time.
0 commit comments