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

make utils a subpackage of snmachine #259

Merged
merged 4 commits into from
Jan 24, 2022

Conversation

heather999
Copy link
Contributor

IMPORTANT: Please create an issue first before opening a Pull Request.
Linked to issue(s): #258

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

What changes were proposed in this pull request?

Making the utils package a subpackage of snmachine.

How is the issue this PR is referenced against solved with this PR?

The utils directory has been moved under snmachine and corresponding code has been updated to reference snmachine.utils where appropriate.

How was this patch tested?

Locally, I modified my copies of the example notebooks to use snmachine.utils and ran through the first 3 notebooks. It is necessary for someone to go through all the notebooks and rerun them to make sure things are ok.

Final Checklist:

  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I am up to date with dev branch of snmachine at the time of this PR

Copy link
Collaborator

@Catarina-Alves Catarina-Alves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heather999 I find it strange that I have no issues running the notebooks because in their imports they have

from snmachine import gps, sndata
from utils.plasticc_pipeline import create_folder_structure, get_directories, load_dataset

With this PR, I assumed that the second line had to be modified to

from snmachine.utils.plasticc_pipeline import ....

however, this modification returns an error and keeping the same does not.

Moreover, the tests didn't run for this PR and I have no way to re-run them, which is strange because for all other PRs I had no issues.

@@ -27,7 +27,7 @@
from sklearn import model_selection
from sklearn.model_selection import PredefinedSplit, StratifiedKFold
from sklearn.preprocessing import StandardScaler
from utils import plasticc_utils
from . utils import plasticc_utils
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is a space between . and utils that should not be here. However, I find no issues running the notebooks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just updated this to from snmachine.utils and that works for me - but it would be great if you could test it too

@Catarina-Alves
Copy link
Collaborator

@heather999 did you have the time to look at my comments regarding this PR?

@heather999
Copy link
Contributor Author

heather999 commented Jan 6, 2022

@Catarina-Alves I think this is ready for testing by others. I did the following:

  • Created a new installation of Miniconda with python 3.8
  • Cloned this repo and checked out this branch `general/issue/258/utils-subpackage
  • pip installed snmachine by doing: pip install -e ./snmachine
  • pip install pytest
  • Unpacked the SPCC_SUBSET.tar.gz in the snmachine/example_data directory
  • entered the test directory and ran the tests: py.test -m "not slow" and they passed.

Does that work for you?

@Catarina-Alves
Copy link
Collaborator

@Catarina-Alves I think this is ready for testing by others. I did the following:

  • Created a new installation of Miniconda with python 3.8
  • Cloned this repo and checked out this branch `general/issue/258/utils-subpackage
  • pip installed snmachine by doing: pip install -e ./snmachine
  • pip install pytest
  • Unpacked the SPCC_SUBSET.tar.gz in the snmachine/example_data directory
  • entered the test directory and ran the tests: py.test -m "not slow" and they passed.

Does that work for you?

Yes, thank you. I will now repeat the tests on my local machine. Once they pass, I will merge the PR and update the pip package.

@Catarina-Alves
Copy link
Collaborator

I had to update a few libraries in the setup to make all the tests run. I will now merge the PR, and update the version of snmachine in pip

@Catarina-Alves Catarina-Alves merged commit abe55ba into main Jan 24, 2022
@Catarina-Alves Catarina-Alves deleted the general/issue/258/utils-subpackage branch January 24, 2022 14:13
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