11"""Specifies the base types for parsing and representing BioLector CSV files."""
2- import abc
3- import enum
4- import os
5- import pathlib
6- import typing
7- import urllib .error
8- import urllib .request
9- import warnings
102from collections .abc import Iterable
3+ from pathlib import Path
114from typing import Optional , Sequence , Union
125
13- import numpy
146import pandas
157
168from . import parsing , utils
2012 BLDParser ,
2113 FilterTimeSeries ,
2214 IncompatibleFileError ,
23- InvalidLotNumberError ,
24- LotInformationError ,
25- LotInformationMismatch ,
26- LotInformationNotFound ,
27- NoMeasurementData ,
2815)
2916
3017parsers = {
3320}
3421
3522
36- def get_parser (filepath : Union [str , pathlib . Path ]) -> BLDParser :
23+ def get_parser (filepath : Union [str , Path ]) -> BLDParser :
3724 """Analyzes a raw BioLector file and selects an appropiate parser.
3825
3926 Parameters
4027 ----------
41- filepath : str or pathlib. Path
28+ filepath : str or Path
4229 Path pointing to the file of interest.
4330
4431 Returns
@@ -90,7 +77,7 @@ def get_parser(filepath: Union[str, pathlib.Path]) -> BLDParser:
9077
9178
9279def _parse (
93- filepath : str ,
80+ filepath : Union [ str , Path ] ,
9481 drop_incomplete_cycles : bool ,
9582 lot_number : Optional [int ],
9683 temp : Optional [int ],
@@ -105,7 +92,7 @@ def _parse(
10592
10693 Parameters
10794 ----------
108- filepath : str or pathlib. Path
95+ filepath : str or Path
10996 Path pointing to the file of interest.
11097 drop_incomplete_cycles : bool
11198 If `True`, incomplete cycles at the end are discarded.
@@ -160,7 +147,7 @@ def _parse(
160147
161148
162149def parse (
163- filepaths : Union [str , Sequence [str ]],
150+ filepaths : Union [Union [ str , Path ], Sequence [Union [ str , Path ] ]],
164151 * ,
165152 drop_incomplete_cycles : bool = True ,
166153 lot_number : Optional [int ] = None ,
@@ -176,7 +163,7 @@ def parse(
176163
177164 Parameters
178165 ----------
179- filepaths : str or pathlib. Path or iterable
166+ filepaths : str or Path or iterable
180167 Path pointing to the file(s) of interest.
181168 If an iterable is provided, files are concatenated.
182169 drop_incomplete_cycles : bool
0 commit comments