Change import statements with try except to enable explicit import of submodules from import to avoid conflicts with parent project.
This commit is contained in:
@ -22,9 +22,15 @@ from datetime import datetime
|
||||
from itertools import chain
|
||||
|
||||
# Import DIMA modules
|
||||
import src.hdf5_writer as hdf5_lib
|
||||
import utils.g5505_utils as utils
|
||||
from instruments.readers import filereader_registry
|
||||
try:
|
||||
from dima.src import hdf5_writer as hdf5_lib
|
||||
from dima.utils import g5505_utils as utils
|
||||
from dima.instruments.readers import filereader_registry
|
||||
except ModuleNotFoundError:
|
||||
print(':)')
|
||||
import src.hdf5_writer as hdf5_lib
|
||||
import utils.g5505_utils as utils
|
||||
from instruments.readers import filereader_registry
|
||||
|
||||
allowed_file_extensions = filereader_registry.file_extensions
|
||||
|
||||
|
@ -15,7 +15,12 @@ if dimaPath not in sys.path: # Avoid duplicate entries
|
||||
|
||||
import h5py
|
||||
import yaml
|
||||
import src.hdf5_ops as hdf5_ops
|
||||
|
||||
try:
|
||||
from dima.src import hdf5_ops as hdf5_ops
|
||||
except ModuleNotFoundError:
|
||||
import src.hdf5_ops as hdf5_ops
|
||||
|
||||
|
||||
|
||||
def load_yaml(review_yaml_file):
|
||||
|
Reference in New Issue
Block a user