Giter Club home page Giter Club logo

aiidalab-home's Introduction

Documentation Status codecov

AiiDAlab package

The aiidalab package sets up the python environment found on the AiiDAlab.

Installation

Install latest version from pypi:

pip install aiidalab

or from the conda-forge conda channel:

conda install -c conda-forge aiidalab

Documentation

The documentation can be found on the following web page.

For maintainers

To create a new release, clone the repository, install development dependencies with pip install -e '.[dev]', and then execute bumpver update. This will:

  1. Create a tagged release with bumped version and push it to the repository.
  2. Trigger a GitHub actions workflow that creates a GitHub release.

Additional notes:

  • Use the --dry option to preview the release change.
  • The release tag (e.g. a/b/rc) is determined from the last release. Use the --tag option to switch the release tag.

License

MIT

Citation

Users of AiiDAlab are kindly asked to cite the following publication in their own work:

A. V. Yakutovich et al., Comp. Mat. Sci. 188, 110165 (2021). DOI:10.1016/j.commatsci.2020.110165

Contact

[email protected]

Acknowledgements

This work is supported by the MARVEL National Centre for Competency in Research funded by the Swiss National Science Foundation, as well as by the MaX European Centre of Excellence funded by the Horizon 2020 EINFRA-5 program, Grant No. 676598.

MARVEL MaX

aiidalab-home's People

Contributors

casperwa avatar csadorf avatar danielhollas avatar dependabot[bot] avatar dou-du avatar edditler avatar ltalirz avatar oschuett avatar pre-commit-ci[bot] avatar unkcpz avatar yakutovicha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aiidalab-home's Issues

Implement end-point that triggers app installation prior to redirect

User stories

As a user, I would like to have a special link that not only opens an AiiDAlab app, but also ensure that it is installed so that I do not need to manually install an app in order to be able to use it.

As an app provider I would like to be able to provide a link that users can use to automatically install and open an app so that I can guarantee that a user can use my app without needing to manually install it.

Context

Right now we use the standard /user-redirect endpoint to be able to provide links directly to app interfaces. This however assumes that the app is already installed. In case that the app is not yet installed, it would simply result in a 404.

Proposed solution

Implement a home app install tool that implements an arbitrary application and then automatically redirects to the correct app. The URL for this tool would be of the form:

/apps/apps/home/install.ipynb?app=<app-url>&redirect=<app-entrypoint>

Example:

https://demo.aiidalab.net/apps/apps/home/install.ipynb?app=my-app&redirect=/apps/apps/my_app/start.ipynb

app metadata logo key error

I got the following error but can not anchor which app cause it. It would be better if the error message is more detailed to tell the user where the app metadata structure incompatibility happened.

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/opt/aiidalab-home/home/start_page.py in render(self)
    106                 # Create app widget if it has not been created yet.
    107                 if name not in self._app_widgets:
--> 108                     self._app_widgets[name] = self._create_app_widget(name)
    109 
    110                 display(self._app_widgets[name])

/opt/aiidalab-home/home/start_page.py in _create_app_widget(self, name)
     66         """Create the widget representing the app on the home screen."""
     67         config = self.read_config()
---> 68         app = AiidaLabApp(name, None, AIIDALAB_APPS)
     69 
     70         if name == "home":

/opt/conda/lib/python3.7/site-packages/aiidalab/app.py in __init__(self, name, app_data, aiidalab_apps_path, watch)
    563 
    564         self.name = self._app.name
--> 565         self.logo = self._app.metadata["logo"]
    566         self.categories = self._app.metadata["categories"]
    567         self.is_installed = self._app.is_installed

KeyError: 'logo'

AppStore vs other git platforms (not only github)

This is just to keep in mind that I haven't tested the home app in general and AppStore in particular against other git platforms (apart from github).

This means that if there will be an AiiDAlab App located on Bitbucket (for example) - then I cannot guarantee that the Home app will keep working normally.

Show the edge version of an app from the latest commit of the default branch in the pre-release list

The available version list will fetch the tags of the specified branch of an app. For app developer, they are willing to quickly see the newest change they merge to the default branch without making the release by adding the tag.
It would be helpful if the edge version can be list in the version list of version selector widget when the pre-release checkbok is ticked. This will allow user to install the edge commit immediatly.

Lazy url request

The caching of apps_meta.json is already enabled employing requests_cache package, however we want to have something as lazy caching. If the repository server gets down, the caching machinery should return the cached information first and later update the cache in the background.

App manager: clear the previous output upon starting a new install

To reproduce:

  1. Trigger and install of an app version that you know will fail. In that case, the output of the pip install command will remain on the screen (which is good).
  2. Select a different version, retrigger an installation. The output from the previous install will not be cleared, but will be appended instead.

Make the separator between apps in Appstore visible

In the appstore we render all apps below each other. There is <hr> element as a visual separator, but it is not that much visible, (on one of my monitors with lower brightness, it is actually invisible).

display(ipw.HTML("<hr>")) # horizontal line
, but (at least in my browser) it is not visible since its color is white.

We need to add some styling to it. We should also adjust the overall whitespace around the apps, it seems currently there's a bit too much of it.

Disable the confirmation dialog for static pages

Currently, whenever you try to navigate away from an appmode app (e.g. by clicking a URL link, or closing a tab), I almost always get a confirmation dialog, even if I didn't really interact with the page. This gets especially annoying for the home app (e.g. every time I want to close it, I need to confirm).

I would propose to disable this dialog for pages that are static, such as the home page, appstore and perhaps others.

I've tested that the following code in a jupyter code cell achieves the effect.

%%javascript
window.onbeforeunload = function() {return}

The original dialog seems to come from jupyter notebook, see file /opt/conda/lib/python3.9/site-packages/notebook/static/notebook/js/notebook.js

I've verified that even with the override, the python kernel gets killed when the app window is closed. It seems that this is handled by the appmode via the event listener here:

https://github.com/oschuett/appmode/blob/master/appmode/static/main.js#L26

Of course this would need to be tested more carefully.

@unkcpz @yakutovicha LMK your thoughts on this, happy to take this on if you agree, once we're done with the current changes.

AppStore UI issues

Here's what I see on Firefox 88.0 on Linux Mint

obrazek

I think the word "Description:" is redundant here. Also, there is a lot of white space between the various UI elements (might be a CSS artifact of my browser? Need to check)

multistage_geo_opt_ddec in LSMO App not working

Hey,
I am not sure if this is the right place to report the issue but I couldn't find a repo for the App.
When I try to launch the Geometry Optimisation and Charges calculation I get this error:

`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_583173/1428171309.py in <cell line: 18>()
16
17 # Local imports.
---> 18 from utils.mof_checker import MofCheckerWidget, CheckMofStructure
19
20 # Workchains.

~/apps/aiidalab-lsmo/utils/mof_checker/init.py in
5 from ase import Atom, Atoms
6 from IPython.display import clear_output, display
----> 7 from mofchecker import MOFChecker
8 from traitlets import Instance, Int, List, observe
9

~/.local/lib/python3.8/site-packages/mofchecker/init.py in
16 from pymatgen.io.cif import CifParser
17 from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
---> 18 from structuregraph_helpers.analysis import get_cn
19 from structuregraph_helpers.create import construct_clean_graph, get_structure_graph
20 from structuregraph_helpers.hash import (

ModuleNotFoundError: No module named 'structuregraph_helpers'`

The other calculations work fine. @yakutovicha can you help here? It's also not super urgent as we won't use it in the class. Thank you!

UI: Improve rolling output when installing in AppStore

The output from pip when installing from AppStore only shows 5 lines, which makes it quite hard to see what is happening. Also, the output does not automatically roll down while the installation is ongoing.

obrazek

The output disappears after the installation is complete, although I would personally prefer if it stayed there even after the successfully install in case one wants to inspect the details (in the case we need to make it very obvious that the installation finished successfully). But here opinions can differ. :-)

The app store displays confusing incompatibility warning during app installation

Observed behavior

When installing a new app, the app store will show a confusing warning:

The installed version of this app is not compatible with this AiiDAlab environment.

See also screenshot:

Screen Shot 2022-06-28 at 12 38 38

Expected behavior

The app store should not check compatibility during the installation, but only after the installation has completed.

Installed App stuck in Loading state in home app

This is what I saw in the top-right corner of my app when I loaded the home page.

obrazek

I wasn't able to reproduce this since then, but we should keep an eye.
The app statuses are displayed via the AppStatusInfoWidget, but the cause of this is likely elsewhere.

error for empty .launcher.conf (+ hard to debug)

In Quantum Mobile, launching the mc-home app for the first time writes an empty .launcher.conf into the app directory.
This causes the app to crash, when one runs it a second time.

Since the .conf file is executed via eval, the error message is rather cryptic for python standards:

File "<string>"
SyntaxError: unexpected EOF while parsing

I'll make a pull request for this in a bit.

re-enable tests in CI

There are a couple of basic selenium tests in tests/ folder, but they are currently not being run in GHA.

These tests need to run inside the aiidalab docker image. We should port the notebook test infrastructure from AWB and re-enable the tests in CI.

Home page - ordering apps

Related to #18, specifically the line:

  • Allows to modify the apps order

Under Home page.

This should be extended to something more specific. Namely, the ordering should be done in a more agile and easy way, instead of now, where one has to click several times to set the order of apps.

Change suggestions:

  • Create pop-up window, where the order may be set.
  • Have a separate notebook (with app-mode), where the order may be set.
  • Drag-and-drop the existing apps directly on the home page to reorder.
  • Give each app a number to the side that may be changed directly on the home page.

Incorrect tooltip on the Install button

Here's what I see in the latest docker stack. Here the example is AWB, but other apps suffer from this as well.

obrazek

Note that the button is active, but the tooltip says the app is incompatible, even though it clearly is. I've looked at the code in the app_manager.py but couldn't see an obvious problem. It's possible the underlying issue is in the aiidalab package.

Implement AiiDA-control page

This page should provide user-friendly tools to interact with AiiDA. The features might include:

  • Interacting with processes
  • Interacting with database
  • Interacting with daemon
  • Interacting with groups
  • Interacting with profiles

Related issues:

Add metadata.json for python requirements

i.e. that the Quantum Mobile can read and "understand" what needs to be installed for the app to work.

I believe the requirements to install into the aiida environment (as opposed to the jupyter one) are:

  • aiidalab==20.11.0b1
  • ipython
  • ipywidgets
  • jinja2
  • markdown
  • traitlets

Updating app can trigger TraitError

Under some circumstances, updating an app can trigger a TraitError.

This bug occurred when I tried to update the OPTIMADE app via the app manager. The exact circumstances and causes for this issue are unknown, but this might be related to the local git repository and the git data from the apps metadata being out-of-sync. More investigation is required to determine the cause of the issue.

Traceback:

---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in findvalue(array, value, compare)
    136     try:
--> 137         return next(x for x in array if compare(x, value))
    138     except StopIteration:

StopIteration: 

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in _validate_value(self, proposal)
    240         try:
--> 241             return findvalue(self._options_values, value, self.equals) if value is not None else None
    242         except ValueError:

/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in findvalue(array, value, compare)
    138     except StopIteration:
--> 139         raise ValueError('%r not in array'%value)
    140 

ValueError: 'git:refs/tags/v1.2.2' not in array

During handling of the above exception, another exception occurred:

TraitError                                Traceback (most recent call last)
~/local/aiidalab-home/home/app_manager.py in _update_app(self, _)
    279             self._show_msg_failure(str(error))
    280         else:
--> 281             self.version_selector.version_to_install.value = version
    282             self._show_msg_success("Updated app.")
    283 

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    602             raise TraitError('The "%s" trait is read-only.' % self.name)
    603         else:
--> 604             self.set(obj, value)
    605 
    606     def _validate(self, obj, value):

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value)
    576 
    577     def set(self, obj, value):
--> 578         new_value = self._validate(obj, value)
    579         try:
    580             old_value = obj._trait_values[self.name]

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _validate(self, obj, value)
    610             value = self.validate(obj, value)
    611         if obj._cross_validation_lock is False:
--> 612             value = self._cross_validate(obj, value)
    613         return value
    614 

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _cross_validate(self, obj, value)
    616         if self.name in obj._trait_validators:
    617             proposal = Bunch({'trait': self, 'value': value, 'owner': obj})
--> 618             value = obj._trait_validators[self.name](obj, proposal)
    619         elif hasattr(obj, '_%s_validate' % self.name):
    620             meth_name = '_%s_validate' % self.name

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __call__(self, *args, **kwargs)
    973         """Pass `*args` and `**kwargs` to the handler's function if it exists."""
    974         if hasattr(self, 'func'):
--> 975             return self.func(*args, **kwargs)
    976         else:
    977             return self._init_call(*args, **kwargs)

/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in _validate_value(self, proposal)
    241             return findvalue(self._options_values, value, self.equals) if value is not None else None
    242         except ValueError:
--> 243             raise TraitError('Invalid selection: value not found')
    244 
    245     @observe('value')

TraitError: Invalid selection: value not found

Hide the pre-release checkbox in app store gallery

Suggested by @danielhollas,

the include pre-releases" toggle may better be hidden. If the user wants a pre-release, they should probably go to the "manage app" page anyway.

I don't fully agree with this, we have this functionality and it benefits for the user when need to keep it here. In essence, AiiDAlab encourages quick development so the pre-release should be common. Let's discuss!

Implement "factory reset"

I am not sure, whether this is the right repository for this, but I would like to keep track of an enhancement proposal that I have been thinking about for a while now.

I think it would be extremely useful to have a "factory reset" button, that would allow users (and administrators), to reset the AiiDAlab environment to "factory conditions", that means basically that the environment is completely reset. Use cases include, but are not limited to:

  1. The ability to test the "new user" experience, especially for testing and in preparation for workshops etc.
  2. The ability for users to reset their environment after having it rendered inadvertently unusable in some way.

Add user notification system

It would be good to have some kind of notification systems that automatically informs users of upcoming events, maintenance periods, upcoming changes to the platform, or anything else that is noteworthy.

I imagine some kind of banner at the top that can potentially be closed by users. The way that I imagine the implementation is that we add notifications to the registry that are specific to the domain, a time period, and potentially, some other user condition (e.g. checking for the existence for certain paths or so), and which the home app then automatically checks for at start up and presents to the user.

Here is a draft for how such a registry entry could look like:

"notifications": [
  {
    "domain": "aiidalab-demo.materialscloud.org",
    "after": "2020-12-24T00:00:00",
    "before": "2020-12-25T00:00:00",
    "message": "Merry Christmas!",
    "category": "info",
  }
]

Defaults would be:

"domain": ".*",
"after": ""
"before": ""
"category": "info",

Additional notes:

  • There could be an optional "condition" object, that could be used for checks. I imagine that we implement certain checks that can be made, package version, existence of a specific file etc.
  • The message should be accepted in (sanitized) HTML format to make it easy to customize notifications and embed images etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.