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

Prototypes a new isolation interface #266

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

miguelgondu
Copy link
Collaborator

No description provided.

@miguelgondu
Copy link
Collaborator Author

miguelgondu commented Oct 1, 2024

Hi @SimonBartels, @RMichae1.

Could I ask you to take a look into the last two tests of test_force_isolation.py? Don't worry about the other files for now.

I'm prototyping a new isolation interface that will hopefully be more reliable than the current one we have. In a nutshell:

  • we stop using conda.
  • we stop registering problems.
  • The user simply provides a python executable in which to run the isolated script.

Something like:

from pathlib import Path

from poli.objective_factory import create

problem = create(
    name="rasp",
    wildtype_pdb_path=Path(__file__).parent.parent
    / "static_files_for_tests"
    / "3ned.pdb",
    python_executable_for_isolation="/Users/sjt972/anaconda3/envs/poli__rasp/bin/python",
)

@SimonBartels
Copy link
Collaborator

Interesting approach. So the environment is defined through the executable? Sounds awesome. This also implies support for virtualenv and what not, right?
Yeah, maybe this is the easier solution. In my case, the executable is essentially determined by the problem name, which is why I like a registry. But I also see that this approach is more transparent for new users, less error-prone for them, and it's a good trim for poli.

@miguelgondu
Copy link
Collaborator Author

Yeah, precisely. We should only assume that the user has python. Assuming that they have virtualenv, conda, mamba or uv imposes a lot on us, and adds restrictions to the user. It would also allow us to put poli on pypi.

That being said, I still think we should provide conda envs in which things run reliably.

@miguelgondu
Copy link
Collaborator Author

It seems that running w. the python executable of an env is not enough, because a conda activate modifies the path: https://stackoverflow.com/a/65564255

@SimonBartels
Copy link
Collaborator

Hm. And there are other possible environment changes affecting for example numpy through a different glibc or what not. What's your current stance?

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