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

directory for the config file #56

Open
sichendart opened this issue Feb 10, 2020 · 6 comments
Open

directory for the config file #56

sichendart opened this issue Feb 10, 2020 · 6 comments

Comments

@sichendart
Copy link
Contributor

By doing the following, the xrftomo.config was generated under /Users/sichen

(XRFtomo) Ahri-59:XRFtomo sichen$ pwd
/Users/sichen/src/XRFtomo
(XRFtomo) Ahri-59:XRFtomo sichen$ XRFtomo init

It makes more sense to generate it under /Users/sichen/src/XRFtomo. I also check the directory for the configure file when the software is quit. It is under /Users/sichen/src/XRFtomo.

@decarlof
Copy link
Member

Actually this change was intentional: Most of the users will not built the code from source by rather install it from a conda channel. In this case is better to save the config in a location that always exists (user home) rather than the directory from where it was lunched.

@sichendart
Copy link
Contributor Author

OK. In that case, shall we always save the config file in the user home directory, for example, when we save from the menu or when the software quits.

@decarlof
Copy link
Member

correct, the config file is designed to keep the status of the software on file exit, its location is set in this line of the config.py file and stays the same so the program can restore its status at startup as well save it on quit.

@FabricioSMarin
Copy link
Collaborator

FabricioSMarin commented Feb 12, 2020

I find that xrftomo.conf gets created in the bin directory if there is one not already available in the home directory when running xrftomo gui. Entering xrftomo init on the other hand does create the file in the home directory. I'm not sure if this is intentional or if it can be changed to automatically save to the home path regardless of initializing first with xrftomo init or not.

@decarlof
Copy link
Member

This in not the intentional behavior: there should be only one config file. In this line the config file name is hard coded. This should be changed in:

config.write(args.config, args=self.params, sections=sections)

@FabricioSMarin
Copy link
Collaborator

FabricioSMarin commented Jun 2, 2020

I'm using expanduser("~") to find the home path and write the config file there. Would something like this work? So far I haven't encountered issues with starting XRFtomo from any window or path.

from os.path import expanduser            

home = expanduser("~")
config.write('{}/xrftomo.conf'.format(home), args=self.params, sections=sections)

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

No branches or pull requests

3 participants