Skip to content

Commit 4b33053

Browse files
authored
Update print statements to use logging in json_writer.py (#201)
* Update print statements to use logging in `json_writer.py` * Update print statements in `histogram_plot_reader`
1 parent 2280752 commit 4b33053

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

simulariumio/cellpack/cellpack_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def _read(self, input_data: CellpackData) -> TrajectoryData:
362362
"""
363363
Return a TrajectoryData object containing the Cellpack data
364364
"""
365-
print("Reading Cellpack Data -------------")
365+
log.info("Reading Cellpack Data -------------")
366366
# currently only converts one model, ie one time step
367367
time_step_index = 0
368368
# default scale for cellpack => simularium

simulariumio/plot_readers/histogram_plot_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
import logging
5-
from typing import Dict, Any
5+
from typing import Any, Dict
66

77
from .plot_reader import PlotReader
88

@@ -18,7 +18,7 @@ def read(self, data: Dict[str, Any]) -> Dict[str, Any]:
1818
"""
1919
Return an object containing the data shaped for Simularium format
2020
"""
21-
print("Reading Histogram Data -------------")
21+
log.info("Reading Histogram Data -------------")
2222
simularium_data = {}
2323
# layout info
2424
simularium_data["layout"] = {

simulariumio/writers/json_writer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def format_trajectory_data(trajectory_data: TrajectoryData) -> Dict[str, Any]:
124124
trajectory_data: TrajectoryData
125125
the data to format
126126
"""
127-
print("Converting Trajectory Data to JSON -------------")
127+
log.info("Converting Trajectory Data to JSON -------------")
128128
trajectory_data.agent_data._check_subpoints_match_display_type()
129129
simularium_data = {}
130130
# trajectory info
@@ -181,10 +181,10 @@ def save(
181181
if validate_ids:
182182
Writer._validate_ids(trajectory_data)
183183
json_data = JsonWriter.format_trajectory_data(trajectory_data)
184-
print("Writing JSON -------------")
184+
log.info("Writing JSON -------------")
185185
with open(f"{output_path}.simularium", "w+") as outfile:
186186
json.dump(json_data, outfile)
187-
print(f"saved to {output_path}.simularium")
187+
log.info(f"saved to {output_path}.simularium")
188188

189189
@staticmethod
190190
def save_plot_data(plot_data: List[Dict[str, Any]], output_path: str):

0 commit comments

Comments
 (0)