baeda-polito / matrix-profile

Matrix Profile application in building energy field.
https://www.sciencedirect.com/science/article/pii/S037877882200473X?casa_token=ingifeiAbY8AAAAA:Pz8XhBoZk1Pfm86yOy6X74hgccIJIVRzgUF_yxCa0Wu2u0keylRm61i37HHxYo87SiWcIuRFoA
MIT License
2 stars 1 forks source link

FileNotFoundError `time_window_corrected.csv` running basic example #4

Closed agmangas closed 1 week ago

agmangas commented 3 weeks ago

Describe the bug I'm sure there's something I'm missing, but the program raises the following exception when I try to run the basic example bundled in the repository:

$ python -m src.cmp.main src/cmp/data/data.csv Total_Power src/cmp/results/reports/report.html
2024-09-04 19:40:34,391 [INFO](__main__) Arguments: Namespace(input_file='src/cmp/data/data.csv', variable_name='Total_Power', output_file='src/cmp/results/reports/report.html')
2024-09-04 19:40:34,391 [INFO](src.cmp.utils) ⬇️ Downloading file from <src/cmp/data/data.csv>
2024-09-04 19:40:34,410 [INFO](src.cmp.utils) 📊 Data processed successfully
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/agmangas/Documents/Projects/matrix-profile/src/cmp/main.py", line 91, in <module>
    df_time_window = pd.read_csv(os.path.join(path_to_data, "time_window_corrected.csv"))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/agmangas/Documents/Projects/matrix-profile/.venv/lib/python3.11/site-packages/pandas/io/parsers/readers.py", line 1026, in read_csv
    return _read(filepath_or_buffer, kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/agmangas/Documents/Projects/matrix-profile/.venv/lib/python3.11/site-packages/pandas/io/parsers/readers.py", line 620, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/agmangas/Documents/Projects/matrix-profile/.venv/lib/python3.11/site-packages/pandas/io/parsers/readers.py", line 1620, in __init__
    self._engine = self._make_engine(f, self.engine)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/agmangas/Documents/Projects/matrix-profile/.venv/lib/python3.11/site-packages/pandas/io/parsers/readers.py", line 1880, in _make_engine
    self.handles = get_handle(
                   ^^^^^^^^^^^
  File "/Users/agmangas/Documents/Projects/matrix-profile/.venv/lib/python3.11/site-packages/pandas/io/common.py", line 873, in get_handle
    handle = open(
             ^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/agmangas/Documents/Projects/matrix-profile/src/cmp/data/time_window_corrected.csv'

To Reproduce

  1. Clone the repository:
git clone git@github.com:baeda-polito/matrix-profile.git
  1. Install the dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install poetry
poetry install
  1. Run the tool passing the example dataset as input:
python -m src.cmp.main src/cmp/data/data.csv Total_Power src/cmp/results/reports/report.html

Expected behaviour The tool should run as explained in the README.

agmangas commented 2 weeks ago

Hi! Just a friendly reminder 😄 Have you had a chance to replicate this issue on your side?

RobertoChiosa commented 1 week ago

Hi there!

The file was included in the gitignore so you couldn't find it at runtime. Now I committed it in the repository on the dev branch, it will be available on the main branch on the next patch release

PS. By now the file is static but as an improvement it will be generated from the timeseries data uploaded by the user

agmangas commented 1 week ago

Oh, thank you for looking into it. Looking forward to next release 😄

RobertoChiosa commented 1 week ago

New release out, could you try to run it and see if it works? Thanks a lot!