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

Return filename of the data file with simulation results #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ikajic
Copy link
Collaborator

@ikajic ikajic commented May 31, 2016

This PR is a first stab at returning the filename of the data file being stored after running a simulation. This is achieved by adding the filename in the list of default items in the dictionary result maintained in the Benchmark.run().

I personally found this useful when running tons of simulations and wanting to read only a set of the data files which by default are stored in ./data using the Data class. This seemed to me a clearer solution than always reading the whole directory and extracting the files I'm interested in.

I'd be happy to improve this further if it is something generally useful.

@tcstewar
Copy link
Member

Nifty. I've often done a similar thing with the data_dir option -- you can tell the system to store the data in a directory other than data.

@tcstewar
Copy link
Member

Hmm.. do you actually need the result['filename'] column for anything? I guess I'm not seeing how you use this. How do you keep track of which filenames you want to include?

@ikajic
Copy link
Collaborator Author

ikajic commented Jun 1, 2016

I was able to do what I want by creating a new dir for every set of simulations, as you suggested. Since this doesn't require any changes to the existing code, it's a way to go for now. If you don't think the feature in the current PR is useful, feel free to close it, or we can leave it and see if it shows up in the future and then decide.

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.

2 participants