Skip to content

Commit

Permalink
Merge pull request #159 from Mesnage-Org/ns-rse/pyyaml
Browse files Browse the repository at this point in the history
ruamel.yaml > pyYAML; testing and dev dependencies added
  • Loading branch information
ns-rse committed May 22, 2023
2 parents 8c19303 + 5d1ea15 commit 2f9bc90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions pgfinder/pgio.py
Expand Up @@ -10,7 +10,13 @@
import sqlite3
import numpy as np

from ruamel.yaml import YAML, YAMLError
import yaml
from yaml.error import YAMLError

try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader

from pgfinder.logs.logs import LOGGER_NAME

Expand Down Expand Up @@ -343,8 +349,7 @@ def read_yaml(filename: Union[str, Path]) -> Dict:

with Path(filename).open() as f:
try:
yaml_file = YAML(typ="safe")
return yaml_file.load(f)
return yaml.load(f, Loader=Loader)
except YAMLError as exception:
LOGGER.error(exception)
return {}
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Expand Up @@ -42,7 +42,8 @@ tests = [
"pytest>=7.0",
"pytest-cov",
"pytest-mpl",
"pytest-regtest"
"pytest-regtest",
"pytest-xdist"
]
docs = [
"sphinx",
Expand All @@ -59,6 +60,7 @@ docs = [
]
dev = [
"black",
"pre-commit",
"ruff"
]
pypi = [
Expand Down

0 comments on commit 2f9bc90

Please sign in to comment.