README.md 2.95 KB
Newer Older
1
2
3
4
This project tries and test approaches that might lead to an improved architecture for NOMAD (XT).

## Getting started

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
### Install the legacy NOMAD submoduels.
This has to be done differently in the future. For no init the submodules and checkout
working branches/tags:
- submodules/parsers/parser-vasp master
- submodules/python-common master
- submodules/nomad-meta-info 1.6.0

To checkout a tag use:
```
git fetch --all --tags --prune
git checkout tags/1.6.0 -b 1.6.0
```

`pip install -r requirements` in `python-common`, and `pip install -e .` in `python-common` and
`parsers/parser-vasp`. Futhermore, there are some dependency issues in `python-commons` requirments.

21
### Install the python in your own virtual environment.
22
23
24
25
26
27

```
pip install -r requirements.txt
pip install -e .
```

28
29
30
31
32
### Run dev infrastructure with docker.
```
cd ./infrastructure
docker-compose build
docker-compose up
33
34
```

35
36
37
38
39
Optionally register the infrastructue minio host to the minio client (mc).
```
mc config host add minio http://localhost:9007 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
```

40
41
42
43
44
45
46
### Run the celery worker (should be moved to docker TODO)

```
celery -A nomad.processing worker -l info
```
You can use different debug level (e.g. switch `info` to `debug`)

47
48
49
50
51
52
53
54
55
Use watchdog during development. Install (i.e. [fixed](https://github.com/gorakhargosh/watchdog/issues/330) version fo MacOS)
```
pip install git+https://github.com/gorakhargosh/watchdog.git
```

Now use this to auto relead worker:
```
watchmedo auto-restart -d ./nomad -p '*.py' -- celery worker -l info -A nomad.processing
```
56

57
58
59
### Run tests.
```
python tests/test_files.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
```

### Generate the documentation

Install [pdoc](https://pypi.org/project/pdoc/) if necessary, and run this from the project root:
```
pdoc --html --html-dir=./build/docs --overwrite nomad
```

Do serve the current docs via HTTP during development, run
```
pdoc --http --http-port 8080
```
and open [http://localhost:8080/nomad](http://localhost:8080/nomad).

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
We will probably move to Sphynx at an apropriate moment.

## Contributing

### Code quality

- Use an IDE (e.g. [vscode](https://code.visualstudio.com/)) to enforce code [formatting and linting](https://code.visualstudio.com/docs/python/linting).
- There is a style guide to python. Write [pep-8](https://www.python.org/dev/peps/pep-0008/) compliant python code. An exception is the line cap at 79, which can be broken but keep it 90-ish.
- Use docstrings and document any *public* API of each submodule (e.g. python file). Public meaning API that is exposed to other submodules (i.e. other python files). Keep docstrings compliant to [pep-257](https://www.python.org/dev/peps/pep-0257/). Use sphynx references a lot!
- Be [pythonic](https://docs.python-guide.org/writing/style/) and watch [this](https://www.youtube.com/watch?v=wf-BqAjZb8M).
- The project structure is according to [this](https://docs.python-guide.org/writing/structure/) guide. Keep it!
- Test the public API of each submodule (i.e. python file)