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

loading config files and autocomplete give problems in certain cenarios #15

Open
phlpphns opened this issue May 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@phlpphns
Copy link
Collaborator

phlpphns commented May 6, 2024

In the config file the lines:

experiment_dir: '/home/philipp/BEATS/SEM_6/foo/ExpData'
experiment_name: 'foo'
inhouse: False
h5file: ''
h5file_flats: ''
h5file_darks: ''
dataset: '<dataset>'
recon_dir: '/home/philipp/BEATS/SEM_6_recon/foo/recon/'
cor_dir: '/home/philipp/BEATS/SEM_6_recon/foo/cor'

must be filled in a coherent manner up to now. Otherwise the return values are "/". This is especially true, if a directory does not exist yet. Also must the experiment_name be the same as the second to last string in the experiment_dir.

Furthermore, there could be a bug with the autocomplete, making the first autocomplete "fake", since we already give it to start with. Upon subsequent calls, or when loading datasets, the behaviour is as expected though.

In
alrecon/alrecon/components/alrecon.py
we have the function
define_recon_dir_BEATS

def define_recon_dir_BEATS(self, number_heading_directories=5):
	### first 4 elements are defining the root at BEATS, + '/' what gets stripped to ''
	### but since we know the path for BEATS, we could also take a hardcoded thing
	path_ = os.path.abspath(self.experiment_dir.value)
	elements_path = path_.split(os.sep)[:number_heading_directories]
	elements_path[0] = '/'
	dir_recon_root = os.path.join(*elements_path)
	dir_recon_root = f'{dir_recon_root}_recon'
	return dir_recon_root

which is tuned to our BEATS workflows. It was created anticipating other configurations and the way how it is invoked should be revised.

@phlpphns phlpphns added the bug Something isn't working label May 6, 2024
@phlpphns phlpphns self-assigned this May 6, 2024
@phlpphns
Copy link
Collaborator Author

phlpphns commented May 6, 2024

Instead of giving

experiment_dir: '/home/philipp/BEATS/SEM_6/Test1/ExpData'
experiment_name: 'Test1'
inhouse: False
h5file: ''
h5file_flats: ''
h5file_darks: ''
dataset: '<dataset>'
recon_dir: '/home/philipp/BEATS/SEM_6_recon/foo/recon/'
cor_dir: '/home/philipp/BEATS/SEM_6_recon/foo/cor'

note that in recon_dir and cor_dir foo can be replaced by whatsoever, autocomplete does not care, takes the experiment_name + the name of the dataset and a tweaked recon.

A modified convention such as

experiment_dir: '/home/philipp/BEATS/SEM_6/Test1/ExpData'
experiment_name: 'Test1'
inhouse: False
h5file: ''
h5file_flats: ''
h5file_darks: ''
dataset: '<dataset>'
recon_root: '/home/philipp/BEATS/SEM_6_recon/Test1' 
recon_dir: recon
cor_dir: cor

could be a step towards a more robust and understandable procedure.
One problem probably lies in how data are recorded, another one in the config file itself. In yaml references to other fields might be possible though, to achieve e.g. something like

&experiment_name: 'Test1'
experiment_dir: '/home/philipp/BEATS/SEM_6/*experiment_name/ExpData'

if an individual parser should not be used. Let's think about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant