polca / premise

Coupling Integrated Assessment Models output with Life Cycle Assessment.
BSD 3-Clause "New" or "Revised" License
101 stars 45 forks source link

Fix IAM file read-in for external files. #86

Closed Loisel closed 1 year ago

Loisel commented 1 year ago

The following error appeared in the un-patched version:

File ~/miniconda3/envs/premise/lib/python3.10/site-packages/premise/data_collection.py:422, in IAMDataCollection.__get_iam_data(self, key, filepath, variables)
    420     file_ext = self.model + "_" + self.pathway + ".mif"
    421     filepath = Path(filepath) / file_ext
--> 422     with open(filepath, "rb") as file:
    423         # read the encrypted data
    424         encrypted_data = file.read()
    426 # create a temp csv-like file to pass to pandas.read_csv()

FileNotFoundError: [Errno 2] No such file or directory: '~/remind/testruns/test/remind_default.csv/remind_default.mif'