Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/356/task-fr…
Browse files Browse the repository at this point in the history
…om-builder
  • Loading branch information
GeigerJ2 committed Dec 16, 2024
2 parents a97a53b + 7a6291b commit 9280f02
Show file tree
Hide file tree
Showing 221 changed files with 5,372 additions and 50,053 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [pull_request]
on: [push, pull_request]

jobs:

Expand Down Expand Up @@ -79,29 +79,17 @@ jobs:
playwright install
pip list
- name: Install system dependencies
run: sudo apt update && sudo apt install --no-install-recommends graphviz

- name: Create AiiDA profile
run: verdi setup -n --config .github/config/profile.yaml

- name: Install Dependencies for widget
working-directory: aiida_workgraph/widget
run: |
npm install
npm run build
- name: Install Dependencies, Start React Application
working-directory: aiida_workgraph/web/frontend
run: |
npm install
npm run build
- name: Run pytest
env:
AIIDA_WARN_v3: 1
run: |
# Have to split tests into see issue #225
pytest -m "not frontend and not backend" -v --cov --durations=0
pytest -m backend -v --cov-append --durations=0
pytest -m frontend -v --cov-append --durations=0
pytest -v --cov --durations=0
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
- name: Build widget
working-directory: aiida_workgraph/widget/
run: |
npm install
npm run build
- name: Build web frontend package
working-directory: aiida_workgraph/web/frontend/
run: |
npm install
npm run build
- name: Build package
run:
python -m build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,5 @@ dmypy.json
tests/work
/tests/**/*.png
/tests/**/*txt
/tests/**/*html
.vscode
2 changes: 0 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ build:
nodejs: "20" # maybe need to be also miniconda
jobs:
post_create_environment:
- npm --prefix aiida_workgraph/widget install
- npm --prefix aiida_workgraph/widget run build
- python -m pip install --no-cache-dir .[docs]
- python -m pip install --exists-action=w --no-cache-dir -r docs/requirements.txt
- rabbitmq-server -detached
Expand Down
50 changes: 0 additions & 50 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,6 @@ To change the default python path you can set the environment variable
PYTEST_PYTHONJOB_PYTHON_EXEC_PATH=/home/user/pyvenv/workgraph-dev/bin/python pytest tests/test_python.py
```

#### Running frontend tests in headed mode

To debug the frontend tests you often want to see what happens in the tests.
By default they are run in headless mode, so no browser is shown.
To run the frontend tests in headed mode for you have to set an environment variable like this
```console
PYTEST_PLAYWRIGHT_HEADLESS=no pytest -m frontend
```

For the frontend tests we start a web server at port `8000`, please free this address for before running the frontend tests.

### Development on the GUI

For the development on the GUI we use the [REACT](https://react.dev) library
which can automatically refresh on changes of the JS files. To start the backend
server please run

```console
python aiida_workgraph/web/backend/main.py
```

then start the frontend server with
```console
npm --prefix aiida_workgraph/web/frontend start
```

The frontend server will refresh

#### Tools for writing frontend tests

To determine the right commands for invoking DOM elements playwright offers a
tool that outputs commands while navigating through the GUI. It requires a
webserver to be running so it can be started with
```console
workgraph web start
playwright codegen
```

#### Troubleshooting

##### Tests are not updating after changes in code

You might want to clean your cache

```console
npm --prefix aiida_workgraph/web/frontend cache clean
```

and also clear your browsers cache or try to start new private window.


### Building the docs

Expand Down
41 changes: 13 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AiiDA-WorkGraph
[![PyPI version](https://badge.fury.io/py/aiida-workgraph.svg)](https://badge.fury.io/py/aiida-workgraph)
[![Unit test](https://github.com/aiidateam/aiida-workgraph/actions/workflows/ci.yaml/badge.svg)](https://github.com/aiidateam/aiida-workgraph/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/superstar54/aiida-workgraph/branch/main/graph/badge.svg)](https://codecov.io/gh/superstar54/aiida-workgraph)
[![codecov](https://codecov.io/gh/aiidateam/aiida-workgraph/branch/main/graph/badge.svg)](https://codecov.io/gh/aiidateam/aiida-workgraph)
[![Docs status](https://readthedocs.org/projects/aiida-workgraph/badge)](http://aiida-workgraph.readthedocs.io/)

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, error-resistant, and remote execution capabilities.
Expand All @@ -11,7 +11,7 @@ Efficiently design and manage flexible workflows with AiiDA, featuring an intera
## Installation

```console
pip install aiida-workgraph[widget]
pip install aiida-workgraph
```

To install the latest version from source, first clone the repository and then install using `pip`:
Expand All @@ -22,19 +22,6 @@ cd aiida-workgraph
pip install -e .
```

To install the jupyter widget support you need to in addition build the JavaScript packages:

```console
pip install .[widget]
# build widget
cd aiida_workgraph/widget/
npm install
npm run build
# build web frontend
cd ../../aiida_workgraph/web/frontend/
npm install
npm run build
```

## Documentation
Explore the comprehensive [documentation](https://aiida-workgraph.readthedocs.io/en/latest/) to discover all the features and capabilities of AiiDA Workgraph.
Expand Down Expand Up @@ -62,23 +49,28 @@ def multiply(x, y):
wg = WorkGraph("test_add_multiply")
wg.add_task(add, name="add1")
wg.add_task(multiply, name="multiply1")
wg.add_link(wg.tasks["add1"].outputs["result"], wg.tasks["multiply1"].inputs["x"])
wg.add_link(wg.tasks.add1.outputs.result, wg.tasks.multiply1.inputs.x)

```

Prepare inputs and submit the workflow:
Prepare inputs and run the workflow:

```python
from aiida import load_profile

load_profile()

wg.submit(inputs = {"add1": {"x": 2, "y": 3}, "multiply1": {"y": 4}}, wait=True)
print("Result of multiply1 is", wg.tasks["multiply1"].outputs[0].value)
wg.run(inputs = {"add1": {"x": 2, "y": 3}, "multiply1": {"y": 4}})
print("Result of multiply1 is", wg.tasks.multiply1.outputs.result.value)
```

Start the web app, open a terminal and run:
## Web ui
To use the web ui, first install the web ui package:
```console
pip install aiida-workgraph-web-ui
```
Then, start the web app with the following command:
```console

workgraph web start
```

Expand All @@ -104,12 +96,5 @@ pip install -e .[tests,pre-commit]
pre-commit install
```

### Widget
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph/widget/README.md)

### Web app
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph/web/README.md)


## License
[MIT](http://opensource.org/licenses/MIT)
Loading

0 comments on commit 9280f02

Please sign in to comment.