Browse Source

removed debugging output

xmlparsing v0.9.1
Holger Frey 2 years ago
parent
commit
c1bba778b9
  1. 7
      src/sensospot_parser/__init__.py
  2. 1
      src/sensospot_parser/parser.py
  3. 4
      src/sensospot_parser/recordtime.py

7
src/sensospot_parser/__init__.py

@ -3,10 +3,9 @@
Parsing the numerical output from Sensovations Sensospot image analysis. Parsing the numerical output from Sensovations Sensospot image analysis.
""" """
__version__ = "0.9.0" __version__ = "0.9.1"
import sys
from pathlib import Path from pathlib import Path
import click import click
@ -67,10 +66,10 @@ def _output(data, folder, outfile):
outfile: the name of the outfile, '-' will output to stdout outfile: the name of the outfile, '-' will output to stdout
""" """
if outfile.strip() == "-": if outfile.strip() == "-":
data.to_csv(sys.stdout, sep="\t") click.echo(data.to_csv(None, sep="\t", index=False))
else: else:
csv_file = Path(folder) / outfile csv_file = Path(folder) / outfile
data.to_csv(csv_file, sep="\t") data.to_csv(csv_file, sep="\t", index=False)
def _parse_one_folder(source, outfile, quiet): def _parse_one_folder(source, outfile, quiet):

1
src/sensospot_parser/parser.py

@ -227,7 +227,6 @@ def parse_folder(folder: PathLike, quiet: bool = False) -> pandas.DataFrame:
raise ValueError(f"No sensospot data found in folder '{folder}'") raise ValueError(f"No sensospot data found in folder '{folder}'")
data_frame = add_measurement_parameters(data_frame, folder_path) data_frame = add_measurement_parameters(data_frame, folder_path)
data_frame = add_record_time(data_frame, folder_path) data_frame = add_record_time(data_frame, folder_path)
print(data_frame)
if quiet: if quiet:
return data_frame return data_frame
return _sanity_check(data_frame) return _sanity_check(data_frame)

4
src/sensospot_parser/recordtime.py

@ -90,13 +90,9 @@ def add_record_time(
the measurement data with parameters added the measurement data with parameters added
""" """
record_path = _search_records_file(folder) record_path = _search_records_file(folder)
print(f"PATH: {record_path}")
if record_path is None: if record_path is None:
print("assuming record path is None")
measurement[columns.ANALYSIS_DATETIME] = numpy.NAN measurement[columns.ANALYSIS_DATETIME] = numpy.NAN
return measurement return measurement
data_frame = _parse_records_file(record_path) data_frame = _parse_records_file(record_path)
print(data_frame)
print(measurement[columns.ANALYSIS_IMAGE].iloc[0])
return measurement.merge(data_frame, how="left", on=columns.ANALYSIS_IMAGE) return measurement.merge(data_frame, how="left", on=columns.ANALYSIS_IMAGE)

Loading…
Cancel
Save