Skip to content

Commit

Permalink
Deal with unknown instruments with the Unknown driver
Browse files Browse the repository at this point in the history
Rather then rejecting them from enumeration
  • Loading branch information
DavidLutton authored Jun 19, 2024
1 parent 09be048 commit 845b469
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/labtoolkit/Unknown/Unknown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ..instrument import Instrument

class Unknown(Instrument):
"""."""
pass
5 changes: 5 additions & 0 deletions src/labtoolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ def driver_map(self):
self.enumeration = pd.merge(
self.drivers, self.enumeration, how="right", on=['Manufacturer', 'Model']
)
for index, inst in self.enumeration.iterrows():
if pd.isnull(inst['Type']) and pd.isnull(inst['Driver']):
self.enumeration.loc[index, 'Type'] = 'Unknown'
self.enumeration.loc[index, 'Driver'] = 'Unknown'


def drivers_sorted(self):
"""."""
Expand Down

0 comments on commit 845b469

Please sign in to comment.