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

[dev branch] Issues with autometa/config/project.py #56

Closed
4 tasks done
jason-c-kwan opened this issue Apr 30, 2020 · 0 comments · Fixed by #108
Closed
4 tasks done

[dev branch] Issues with autometa/config/project.py #56

jason-c-kwan opened this issue Apr 30, 2020 · 0 comments · Fixed by #108
Assignees

Comments

@jason-c-kwan
Copy link
Collaborator

jason-c-kwan commented Apr 30, 2020

This file handles configuration handling for the Autometa user project. It contains the definition of the Project class. Here are the issues I found:

  1. The docstring for the Project class is not very descriptive and doesn't go into detail about the attributes/properties etc.

  2. There is no docstring for the n_metagenomes property in the Project class.

  3. There is no docstring for the save method in the Property class.

  4. In the add method of the Project class, it basically takes a path to a metagenome config file (supplied through the fpath argument) and is supposed to set up a new directory under the project. However, the first few things that it does is to set up directories and paths that do not use the fpath argument. If the config path it wants to create doesn't exist but the directory that it should be in does:

metagenome_num = self.new_metagenome_num()
metagenome_name = f'metagenome_{metagenome_num:03d}'
metagenome_dirpath = os.path.join(self.dirpath, metagenome_name)
mg_config_fpath = os.path.join(metagenome_dirpath, f'{metagenome_name}.config')
# Check presence of metagenome directory and config
mg_config_present = os.path.exists(mg_config_fpath)
mg_dir_present = os.path.exists(metagenome_dirpath)
if not mg_config_present and mg_dir_present:
raise FileNotFoundError(f'{mg_config_fpath} is not present but the directory exists! Either remove the directory or locate the config file before continuing.')

...then we raise a FileNotFoundError and give a message. However, the message might be confusing to users if the config file they supplied (which has not been used yet), does exist. Perhaps it should be changed to something like "It appears that there is already a metagenome directory as without a config file in the project hierarchy. Please check the integrity of the project file tree."

@jason-c-kwan jason-c-kwan added this to the Aim 0: Release 2.0 milestone Apr 30, 2020
@kaw97 kaw97 self-assigned this May 7, 2020
@evanroyrees evanroyrees self-assigned this Sep 13, 2020
@evanroyrees evanroyrees linked a pull request Sep 13, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants