Skip to content

Commit 845b469

Browse files
authored
Deal with unknown instruments with the Unknown driver
Rather then rejecting them from enumeration
1 parent 09be048 commit 845b469

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/labtoolkit/Unknown/Unknown.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from ..instrument import Instrument
2+
3+
class Unknown(Instrument):
4+
"""."""
5+
pass

src/labtoolkit/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,11 @@ def driver_map(self):
513513
self.enumeration = pd.merge(
514514
self.drivers, self.enumeration, how="right", on=['Manufacturer', 'Model']
515515
)
516+
for index, inst in self.enumeration.iterrows():
517+
if pd.isnull(inst['Type']) and pd.isnull(inst['Driver']):
518+
self.enumeration.loc[index, 'Type'] = 'Unknown'
519+
self.enumeration.loc[index, 'Driver'] = 'Unknown'
520+
516521

517522
def drivers_sorted(self):
518523
"""."""

0 commit comments

Comments
 (0)