-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Track without output bug #1170
Track without output bug #1170
Conversation
@dzumii could you please resolve the conflicts on this branch? Thank you! |
f4f4eaf
to
72f7497
Compare
Done |
@DhanshreeA |
ersilia/core/tracking.py
Outdated
def read_csv(file_path): | ||
""" | ||
Reads a CSV file and returns the data as a list of dictionaries. | ||
|
||
:param file_path: Path to the CSV file. | ||
:return: A list of dictionaries containing the CSV data. | ||
""" | ||
with open(file_path, mode='r') as file: | ||
|
||
with open("output.csv", "w", newline="") as csvfile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can write this file outside either directly in the track function or have a new function called something like "write_result_csv_when_not_a_file". Right now this function is misleading for two reasons:
- It's writing inside when it's supposed to only read csvs
- Every time the function is invoked, it will create a file called 'output.csv' even when an input file (or input) is passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made changes to this, the csv file is written inside the track function if result is a generator object
4ab585d
to
f9a4827
Compare
@dzumii LGTM! Minor documentation changes but rest is good! Edit: I got confused, the PR is good to merge. |
Description
If track flag is used without specifying an output, an error is returned. This is because tracking requires a result parameter, which is the output of a run session. The error is thrown because the output being passed from run into the parameter is a generator object and not a csv file.
Changes Made
Wrote the generator file into a csv file, which is now read into the track function.
Status
Tracing now works without specifying output
To do
Make sure track flag works with all output formats (csv, tsv, json and h5) supported by ersilia
Related to #1131
Closes #1164