Skip to content

Commit dab0d2b

Browse files
committed
Restructure the way rawFileReader sources dotnet library
Fixes #180
1 parent 9e999ef commit dab0d2b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

corems/mass_spectra/input/rawFileReader.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import site
1515
from pathlib import Path
1616
import datetime
17+
import importlib.util
18+
import os
1719

1820
import clr
1921
import pandas as pd
@@ -31,9 +33,9 @@
3133
from corems.encapsulation.factory.parameters import LCMSParameters, default_parameters
3234
from corems.mass_spectra.input.parserbase import SpectraParserInterface
3335

34-
# do not change the order from the imports statements and reference ThermoFisher below
35-
sys.path.append(site.getsitepackages()[0] + "/ext_lib/dotnet/")
36-
sys.path.append("ext_lib/dotnet/")
36+
# Add the path of the Thermo .NET libraries to the system path
37+
spec = importlib.util.find_spec("corems")
38+
sys.path.append(str(Path(os.path.dirname(spec.origin)).parent) + "/ext_lib/dotnet/")
3739

3840
clr.AddReference("ThermoFisher.CommonCore.RawFileReader")
3941
clr.AddReference("ThermoFisher.CommonCore.Data")

0 commit comments

Comments
 (0)