README.md 2.2 KB
Newer Older
Lauri Himanen's avatar
update  
Lauri Himanen committed
1
# __python-common__
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19


This repository contains the common python files that are
part of the [NOMAD Laboratory](http://nomad-lab.eu).
The official version lives at

    git@gitlab.mpcdf.mpg.de:nomad-lab/python-common.git

you can browse it at

    https://gitlab.mpcdf.mpg.de/nomad-lab/python-common

Some things rely on having the nomad-meta-info checked out at the same level.
The simplest way to have this is to check out nomad-lab-base recursively:

    git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git

then this will be in python-common within it.
Lauri Himanen's avatar
Lauri Himanen committed
20

21
# Local Install
22

23 24 25 26
The following instructions were tested on Ubuntu 14.04. With these instructions
you can install the package for the local user (doesn't need root privileges).
First make sure you have [pip](https://pypi.python.org/pypi/pip) available. If
not, you can install it for python 2.x with:
Himanen Lauri's avatar
Himanen Lauri committed
27 28 29 30 31

```sh
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
```
32

33 34 35 36 37 38 39
or for python3 with:

```sh
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
```

40 41
The modules used for parser development are located under the 'nomadcore'
package. If you wish to setup this package locally, you can do so by first
42
installing the required dependencies (use pip3 for python3 setup)
Lauri Himanen's avatar
Lauri Himanen committed
43 44

```sh
Himanen Lauri's avatar
Himanen Lauri committed
45
pip install -r requirements.txt --user
46
#pip3 install -r requirements.txt --user
Lauri Himanen's avatar
Lauri Himanen committed
47 48
```

49 50
and then installing the package itself with the provided installation
script(use python3 for python3 setup)
Lauri Himanen's avatar
Lauri Himanen committed
51 52

```sh
53
python setup.py develop --user
54
#python3 setup.py develop --user
Lauri Himanen's avatar
Update  
Lauri Himanen committed
55
```
Lauri Himanen's avatar
Lauri Himanen committed
56

57 58 59 60 61 62
This will install a development version, which means that if you update the
source code, all the changes will be available immediately without reinstall of
the package. The current setup also assumes a certain location for the metainfo
repository. If you place all the repositories (python-common, nomad-meta-info,
parser repository) in the same folder, things should work.

63
After this the package will be available to import by simply calling
Lauri Himanen's avatar
Lauri Himanen committed
64 65

```python
66
import nomadcore
Lauri Himanen's avatar
Update  
Lauri Himanen committed
67
```
Lauri Himanen's avatar
Lauri Himanen committed
68

69 70 71
in python. The development mode also means that the latest version of the code
is used, so any updates from git will automatically be available. You can
install a static snapshot by using 'install' instead of 'develop'.