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

AiiDA temp profile in shell and Jupyter-notebook #6070

Closed
wants to merge 6 commits into from

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Jul 5, 2023

PR from AiiDA coding week.

Idea

One way to get people started with AiiDA is by offering a services-free option: i.e. just running codes with AiiDA:

  1. Without RabbitMQ: i.e. just running in the Python session.
  2. Without PostgreSQL: i.e. a temporary database (in memory or persistent sqlite)

Implementation: AiiDA temp profile

This PR provides the services-free option for using AiiDA. This will create a temporary profile to:

  • use the in-memory sqlite
  • no RabbitMQ, and process backend set to null, a polling-mechanism is used to check the state of the process.

In the following two places:

  • Interactive terminal. Added an option standalone to verdi shell.
verdi shell --temp
  • Jupyter-notebook. Add a standalone parameter for the aiida command.
%load_ext aiida
aiida temp
  • #TODO add verdi run --temp

To improve

When the user runs the process use submit, it outputs AssertionError: runner does not have a persister. This may make user confuse. Better to

  • disable the submit function in a temp profile.

@superstar54 superstar54 marked this pull request as draft July 5, 2023 09:22
@click.option('--plain', is_flag=True, help='Use a plain Python shell.')
@click.option('--standalone', is_flag=True, help='Use the services-free standalone option.')
Copy link
Member

Choose a reason for hiding this comment

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

as discussed, standalone may be a bit unclear on its behaviour and/or at least the help message should be improved

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I changed it to temp and updated the help message.

@superstar54 superstar54 changed the title AiiDA standalone AiiDA temp profile in shell and Jupyter-notebook Jul 5, 2023
@unkcpz
Copy link
Member

unkcpz commented Jul 6, 2023

Hi @superstar54, thanks for the PR, this one uses sqlite, correct? So it goes after #6023?

@superstar54
Copy link
Member Author

Hi @superstar54, thanks for the PR, this one uses sqlite, correct? So it goes after #6023?

The PR uses the SqliteTempBackend, which is already in the aiida-core. I will list all the backends, and we can discuss which one to use in the meeting afternoon.

@sphuber
Copy link
Contributor

sphuber commented Mar 13, 2024

With us moving towards supporting profiles that don't require any services, I think it might be easier and more consistent to just encourage people use that (e.g. the proposed verdi blitz to create an actual permanent profile that can store data). They can then use that profile as normal with any verdi commands and in interactive notebooks. I think that would be a better approach than implementing temporary profile support in various places. Do you agree @superstar54 ?

@sphuber sphuber closed this Mar 22, 2024
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.

4 participants