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

more things to do with packaging #64

Merged
merged 5 commits into from
Jun 20, 2024
Merged

more things to do with packaging #64

merged 5 commits into from
Jun 20, 2024

Conversation

liam-o-marsh
Copy link
Contributor

  • new version of metatensor
  • fixed the discrepancies between pip's files, requirements.txt and environment.yml
  • added details to readme

@liam-o-marsh liam-o-marsh requested a review from briling June 17, 2024 12:18
qstack/regression/kernel_utils.py Show resolved Hide resolved
@briling
Copy link
Contributor

briling commented Jun 18, 2024

is there a way to auto sync requirements.txt, environment.yml, and pyproject.toml?

@liam-o-marsh
Copy link
Contributor Author

not to my knowledge?
environment.yml and requirements.txt should be somewhat feasible because the idea is fundamentally the same, but syncing this with pyproject.toml sounds more difficult.
At the very least, there should be a way to check that the package list is the same across all three, and that the bounds of the dependencies listed in pyproject.toml are compatible with the rest.

@briling
Copy link
Contributor

briling commented Jun 19, 2024

is it possible to import qstack_qml in the main __init__.py to use it as qstack.qml if it's installed?

@briling
Copy link
Contributor

briling commented Jun 19, 2024

I also can't use qstack_qml if it isn't installed but is just in the path (which is probably how one should not use it but...)

@liam-o-marsh
Copy link
Contributor Author

yeah I can fix both of those

@briling
Copy link
Contributor

briling commented Jun 19, 2024

Thanks!
I'm probably dumb but can't make it work (I can import qstack.qml but nothing further)

@briling briling mentioned this pull request Jun 19, 2024
6 tasks
@liam-o-marsh
Copy link
Contributor Author

liam-o-marsh commented Jun 20, 2024

I admittedly didn't test it.
I can't even import qstack.qml, only from qstack import qml or import qstack; print(qstack.qml) (fixing this on my side for now)
I have no idea how to use b2r2 (read: I didn't want to spend the time learning how to make ase.rxn objects quite yet), but I managed to run qstack.qml.slatm.get_slatm_for_dataset()

@briling
Copy link
Contributor

briling commented Jun 20, 2024

thanks a lot! one still can't do from qstack_qml.slatm import get_slatm_rxn etc but I guess it's fine

@liam-o-marsh
Copy link
Contributor Author

yeah, for this you need to have pip actually install qstack_qml (as one of qstack[all]'s dependencies)
the reason why qstack.qml works even when you didn't is because qstack/qml.py has a trick to modify PYTHONPATH, import, restore PYTHONPATH.

@briling
Copy link
Contributor

briling commented Jun 20, 2024

oh sorry I can't spell. what I meant is this:

>>> import qstack
>>> qstack.__path__
['/home/xe/SOFT/miniconda3/envs/qstack-yuri/lib/python3.10/site-packages/qstack']
>>> from qstack_qml.slatm import get_slatm_rxn
>>> from qstack.qml.slatm import get_slatm_rxn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'qstack.qml.slatm'; 'qstack.qml' is not a package
>>> 

@briling
Copy link
Contributor

briling commented Jun 20, 2024

While the following works and is pretty convenient so all good

>>> from qstack.qml import slatm 
>>> slatm.get_slatm_rxn
<function get_slatm_rxn at 0x7f2fefd591b0>
>>> 

@liam-o-marsh
Copy link
Contributor Author

(also unrelated but I finished the local kernel wrapper thing. Do you want me to put it on another branch?)

@briling
Copy link
Contributor

briling commented Jun 20, 2024

Do you want me to put it on another branch?

Thanks! yes please

Do you think we can merge (squash and merge?) this one?

@liam-o-marsh
Copy link
Contributor Author

Yes, I think so.
(unless you absolutely want some sort of mechanism to ensure some coherence between environment.yml, requirements.txt and pyproject.toml, but I would have to find or implement this first)

@briling
Copy link
Contributor

briling commented Jun 20, 2024

It's fine! It's not something that changes every day and we can do it manually

Do we need to look at/enable these alerts? https://github.com/lcmd-epfl/Q-stack/network/dependencies

@briling briling merged commit c6e487e into master Jun 20, 2024
2 checks passed
@briling briling deleted the new-metatensor branch June 20, 2024 15:40
@liam-o-marsh
Copy link
Contributor Author

don't think so, unless there's like a security issue somehow

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