Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Conversation

Loisel
Copy link
Collaborator

@Loisel Loisel commented Sep 26, 2022

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'

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'
```
@romainsacchi romainsacchi merged commit c34ae27 into master Sep 26, 2022
@romainsacchi romainsacchi deleted the fix/iam_file_readin branch July 22, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants