Skip to content

Commit

Permalink
Try importing either ruamel.yaml or ruamel_yaml (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
lepmik authored and dragly committed Nov 7, 2018
1 parent 14a1223 commit ee5bec6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
5 changes: 4 additions & 1 deletion exdir/core/attribute.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from enum import Enum
import ruamel_yaml as yaml
import os
import numpy as np
import exdir
try:
import ruamel_yaml as yaml
except ImportError:
import ruamel.yaml as yaml

def _quote_strings(value):
if isinstance(value, str):
Expand Down
5 changes: 4 additions & 1 deletion exdir/core/exdir_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

from enum import Enum
import os
import ruamel_yaml as yaml
import warnings
import pathlib
try:
import ruamel_yaml as yaml
except ImportError:
import ruamel.yaml as yaml

import exdir

Expand Down
5 changes: 4 additions & 1 deletion exdir/core/group.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os
import re
import ruamel_yaml as yaml
import pathlib
import numpy as np
import exdir
try:
import ruamel_yaml as yaml
except ImportError:
import ruamel.yaml as yaml
try:
from collections import abc
except ImportError:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_help_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import os
import pathlib
import six
import ruamel_yaml as yaml
import quantities as pq
import numpy as np
import pytest
try:
import ruamel_yaml as yaml
except ImportError:
import ruamel.yaml as yaml

import exdir
import exdir.core
Expand Down Expand Up @@ -217,4 +220,3 @@ def test_open_object(setup_teardown_file):
loaded_grp = exob.open_object(path)

assert grp2 == loaded_grp

5 changes: 4 additions & 1 deletion tests/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

import pytest
import os
import ruamel_yaml as yaml
import pathlib
import exdir
try:
import ruamel_yaml as yaml
except ImportError:
import ruamel.yaml as yaml

from exdir.core import Object, Attribute
# TODO Remove this import and use import <> as <> instead
Expand Down

0 comments on commit ee5bec6

Please sign in to comment.