Skip to content

Commit

Permalink
bug fix (opening a config file in r+ mode) (#217)
Browse files Browse the repository at this point in the history
* set release to true

* adds cgal and gmp to environment.yml

* fix write permission issue in config

* updates pybind11
  • Loading branch information
glyg authored Jan 28, 2021
1 parent b73428e commit 63562a0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ before_install:
- sudo apt-get update
- sudo apt-get install --yes build-essential
- sudo apt-get install --yes git
- sudo apt-get install libcgal-dev libcgal-qt5-dev
- sudo apt-get install libmpfr-dev libgmp-dev libboost-all-dev
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
Expand All @@ -16,7 +16,7 @@ before_install:
- source activate tyssue
- conda install pytest pytest-cov
- pip install coveralls nbval

install:
- python setup.py install

Expand Down
40 changes: 14 additions & 26 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,35 @@ With an Debian like system, this is achieved by:
sudo apt install build-essential cmake g++
```

### Download and install `tyssue` from source

If you want to do that, I assume you allready know how to manage
dependencies on your platform. The simplest way to manage dependencies is to use [`conda`](https://docs.conda.io/en/latest/miniconda.html) to manage the dependencies (you can use [`mamba`](https://github.com/mamba-org/mamba) as a faster alternative to conda).

### Install CGAL
Start by cloning tyssue recursively to also grab pybind11:

You can use a pre-packaged version for your OS. For Debian:
```bash
sudo apt install libcgal-dev
git clone --recursive https://github.com/damcb/tyssue.git
cd tyssue
```
Note that you need version 4.7 or higher.

If you need to install CGAL from source, here is a `cmake` command sufficient to later compile tyssue:
Then create a virtual environement:

```bash
cd CGAL # This is the directory where the CGAL archive was uncompressed
mkdir build && cd build

# needs qt5 for imageio
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCGAL_INSTALL_LIB_DIR=lib \
-DWITH_CGAL_ImageIO=OFF -DWITH_CGAL_Qt5=OFF \
..
make install -j${CPU_COUNT}
conda env create -f environment.yml
```


### Download and install `tyssue` from source

If you want to do that, I assume you allready know how to manage
dependencies on your platform.

```bash
git clone --recursive https://github.com/damcb/tyssue.git
cd tyssue/
Then install python:
```
python setup.py install
```



If all went well, you have successfully installed tyssue.

### Install testing utilities

```sh
pip install pytest pytest-cov nbval
```
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ You can also install tyssue from PyPi, this is a CGAL-less version (pure python)

`python -m pip install --user --upgrade tyssue`

### From source

See [INSTALL.md](INSTALL.md) for a step by step install, including the necessary python environment.


Expand Down
3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ channels:
- conda-forge

dependencies:
- pip
- boost-cpp
- mpfr
- gmp
- cgal
- python>=3.6
- numpy
- scipy
Expand Down
2 changes: 1 addition & 1 deletion pybind11
Submodule pybind11 updated 209 files
2 changes: 1 addition & 1 deletion tyssue/config/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def load_spec(fname):

with open(fname, "r+") as config_file:
with open(fname, "r") as config_file:
spec = json.load(config_file)
return spec

Expand Down

0 comments on commit 63562a0

Please sign in to comment.