Skip to content

Commit 3a4d785

Browse files
committed
Clean up
1 parent 188e5aa commit 3a4d785

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Diff for: src/linkml_arrays/dumpers/yaml_array_file_dumper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from abc import ABCMeta, abstractmethod
55
from collections.abc import Callable
66
from pathlib import Path
7-
from typing import List, Union
7+
from typing import List, Optional, Union
88

99
import numpy as np
1010
import yaml
@@ -88,7 +88,7 @@ def dumps(
8888
self,
8989
element: Union[YAMLRoot, BaseModel],
9090
schemaview: SchemaView,
91-
output_dir: Union[str, Path] = None,
91+
output_dir: Optional[Union[str, Path]] = None,
9292
**kwargs,
9393
) -> str:
9494
"""Return element formatted as a YAML string."""

Diff for: src/linkml_arrays/dumpers/yaml_hdf5_dumper.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def write_array(
2424
"""Write an array to an HDF5 file."""
2525
# TODO do not assume that there is only one by this name
2626
# 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)
2729
output_file_path = output_file_path_no_suffix.parent / (
2830
output_file_path_no_suffix.name + cls.FILE_SUFFIX
2931
)

Diff for: src/linkml_arrays/dumpers/yaml_numpy_dumper.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def write_array(
2323
"""Write an array to a NumPy file."""
2424
# TODO do not assume that there is only one by this name
2525
# 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)
2628
output_file_path = output_file_path_no_suffix.parent / (
2729
output_file_path_no_suffix.name + cls.FILE_SUFFIX
2830
)

Diff for: tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ envlist =
1515
lint
1616
flake8
1717
mypy
18-
docstr-coverage
18+
; docstr-coverage
1919
py
2020

2121
[testenv]
@@ -100,4 +100,4 @@ deps =
100100
docstr-coverage
101101
commands =
102102
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

0 commit comments

Comments
 (0)