diff --git a/README.md b/README.md index 9cdfbcf..eafc3f9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Plotbox -A quick MatPlotLib data visualization tool +A quick MatPlotLib data visualization tool, currently a little jank. + +First argument is the path to a CSV file, in the future more data formats are desired. + +Can run with uv `uv run plotbox .\IDCJAC0009_040976_1800_Data.csv` or once installed into an environment `python -m plotbox .\IDCJAC0009_040976_1800_Data.csv` Rainfall Data `IDCJAC0009_040976_1800_Data.csv` obtained from BOM (https://www.bom.gov.au/jsp/ncc/cdio/weatherData/av?p_nccObsCode=136&p_display_type=dailyDataFile&p_startYear=2025&p_c=-335807484&p_stn_num=040976) on the 2026-02-20 \ No newline at end of file diff --git a/__pycache__/plotbox.cpython-313.pyc b/__pycache__/plotbox.cpython-313.pyc deleted file mode 100644 index 9783e2e..0000000 Binary files a/__pycache__/plotbox.cpython-313.pyc and /dev/null differ diff --git a/src/plotbox/plotbox.py b/src/plotbox/plotbox.py index 2aa1a40..aced84a 100644 --- a/src/plotbox/plotbox.py +++ b/src/plotbox/plotbox.py @@ -22,16 +22,19 @@ def main(): data = {} numeric_headers = [] - headers = np.genfromtxt(data_path, delimiter=",", skip_header=0, max_rows=1, dtype=str) + headers = np.genfromtxt(data_path, delimiter=",", skip_header=0, max_rows=1, dtype=str, comments="#") for i, header in enumerate(headers): - data[header] = np.genfromtxt(data_path, delimiter=",", skip_header=1, max_rows=None, dtype=float, usecols=(i,)) + data[header] = np.genfromtxt(data_path, delimiter=",", skip_header=1, max_rows=None, comments="#", dtype=float, usecols=(i,)) if np.isnan(data[header][0]): - data[header] = np.genfromtxt(data_path, delimiter=",", skip_header=1, max_rows=None, dtype=str, usecols=(i,)) + data[header] = np.genfromtxt(data_path, delimiter=",", skip_header=1, max_rows=None, dtype=str, comments="#", usecols=(i,)) else: numeric_headers.append(header) - data["Index"] = tuple(range(len(data[numeric_headers[0]]))) + if len(numeric_headers) > 0: + data["Index"] = tuple(range(len(data[numeric_headers[0]]))) + else: + data["Index"] = tuple(range(len(data[headers[0]]))) fig, ax = plt.subplot_mosaic( [