OpenFermion icon indicating copy to clipboard operation
OpenFermion copied to clipboard

Change default data location to current working directory

Open jarrodmcc opened this issue 6 years ago • 6 comments

Right now using most of the plugins or MolecularData class will default to the installation directory specified in the config file, which could be in a very inconvenient location for some people. Also, in my own workflows I'm most interested in keeping data local to a particular project rather than OpenFermion itself, hence it would be better if the universal defaults were the working directory of the user of the code, rather than the installation directory. It should also be the case that when filenames are passed of the form "./data/myfilename.hdf5", that this is the 'data' directory within the current working directory, not in the installation data directory. Any thoughts to the contrary?

jarrodmcc avatar Mar 21 '18 17:03 jarrodmcc

+1, it was pointed out to me (didn't know this was a thing at all) that storing data in lib/.../site-packages is considered bad form and that that directory is usually considered semi-volatile.

idk3 avatar Mar 21 '18 17:03 idk3

This might be unique to me and how I use OpenFermion, but I appreciate having all the data in one place. I tend to sort directories by molecule/ensemble, and having all data about various molecules/basis sets in one place makes it very convenient to sort through files/analyze things.

TariniHardikar avatar Mar 21 '18 19:03 TariniHardikar

Given the above two comments, I guess this sort of implies we want it out of the installation directory, but some people might prefer to keep a central repository, sort of database style, instead of defaulting to the current working directory. I suppose the dividing line here is if you group projects within a data directory and keep scripts from them separate, or you group projects with scripts and data together. I do the latter, because sometimes my projects have some contextual element that I don't want to include in a filename, e.g. I'm doing everything in this project truncated to an active space generated in a specific way. Perhaps we can split the difference and make the default the current working directory, with the option to fix this to another directory as it is done now in config?

On Wed, Mar 21, 2018 at 12:45 PM, Tarini Hardikar [email protected] wrote:

This might be unique to me and how I use OpenFermion, but I appreciate having all the data in one place. I tend to sort directories by molecule/ensemble, and having all data about various molecules/basis sets in one place makes it very convenient to sort through files/analyze things.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quantumlib/OpenFermion/issues/270#issuecomment-375072066, or mute the thread https://github.com/notifications/unsubscribe-auth/AHXFPFcrRhGCkcf4uxM2a33Y50TLg2rFks5tgq3OgaJpZM4S005I .

jarrodmcc avatar Mar 21 '18 21:03 jarrodmcc

I like @jarrodmcc 's last idea. Perhaps the setting of the directory can be done with a function, like openfermion.set_data_directory('DIRECTORY_NAME') or something like that.

kevinsung avatar Mar 21 '18 21:03 kevinsung

Setters are usually not necessary without a specific reason, I think it's simpler to just change the variable here. Thoughts on saving into cwd/OpenFermion-data/ or something instead of directly into cwd?

idk3 avatar Mar 21 '18 22:03 idk3

I'd still opt for the default being that the user has maximal control relative to cwd for determining the directory.

With regards to "setters", anything of that sort is probably still better than now, where the options are basically to (1) specify an absolute path or (2) manually change the config setting in the file in the installation directory.

On Wed, Mar 21, 2018 at 3:15 PM, idk3 [email protected] wrote:

Setters are usually not necessary without a specific reason, I think it's simpler to just change the variable here. Thoughts on saving into cwd/OpenFermion-data/ or something instead of directly into cwd?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quantumlib/OpenFermion/issues/270#issuecomment-375113781, or mute the thread https://github.com/notifications/unsubscribe-auth/AHXFPPdK4Dfg0diZLzT1TKFsBmp-jscLks5tgtD7gaJpZM4S005I .

jarrodmcc avatar Mar 22 '18 00:03 jarrodmcc