Skip to content

Commit

Permalink
Merge pull request #115 from alan-turing-institute/install
Browse files Browse the repository at this point in the history
Install GRACE from conda environment
  • Loading branch information
chris-soelistyo authored Jul 26, 2023
2 parents 995848d + 2d45491 commit 9813117
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 6 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,36 @@ The `grace` workflow consists of the following steps:
For local development, clone the repo and install in editable mode:

```sh
# clone the grace GitHub repository

git clone https://github.com/alan-turing-institute/grace.git
cd ./grace

# create a conda playground from environment.yaml
conda env create -f environment.yaml

# To activate this environment, use
#
# $ conda activate grace-environment
#
# To deactivate an active environment, use
#
# $ conda deactivate

conda activate grace-environment

# install grace from local folder (not on pypi yet)

pip install -e ".[dev]"

# install pre-commit separately

conda install -c conda-forge pre_commit

# follow the hooks from .pre-commit-config.yaml

pre-commit install

```

---
Expand Down
103 changes: 103 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: grace_env
channels:
- conda-forge
- defaults
dependencies:
- brotli-python=1.0.9
- bzip2=1.0.8
- ca-certificates=2023.5.7
- certifi=2023.5.7
- charset-normalizer=3.2.0
- idna=3.4
- joblib=1.3.0
- libblas=3.9.0
- libcblas=3.9.0
- libcxx=16.0.6
- libexpat=2.5.0
- libffi=3.4.2
- libgfortran=5.0.0
- libgfortran5=12.2.0
- liblapack=3.9.0
- libopenblas=0.3.23
- libsqlite=3.42.0
- libzlib=1.2.13
- llvm-openmp=16.0.6
- ncurses=6.4
- numpy=1.25.1
- openssl=3.1.1
- packaging=23.1
- pip=23.1.2
- platformdirs=3.8.1
- pooch=1.7.0
- pysocks=1.7.1
- python=3.11.4
- python_abi=3.11
- readline=8.2
- requests=2.31.0
- scikit-learn=1.3.0
- scipy=1.11.1
- setuptools=68.0.0
- threadpoolctl=3.1.0
- tk=8.6.12
- typing-extensions
- typing_extensions
- wheel=0.40.0
- xz=5.2.6
- pip:
- absl-py==1.4.0
- cachetools==5.3.1
- click==8.1.6
- contourpy==1.1.0
- cvxopt==1.3.1
- cycler==0.11.0
- filelock==3.12.2
- fonttools==4.40.0
- google-auth==2.21.0
- google-auth-oauthlib==1.0.0
- grpcio==1.56.0
- imageio==2.31.1
- iniconfig==2.0.0
- jinja2==3.1.2
- kiwisolver==1.4.4
- lazy-loader==0.3
- magicgui==0.7.2
- markdown==3.4.3
- markupsafe==2.1.3
- matplotlib==3.7.2
- mpmath==1.3.0
- mrcfile==1.4.3
- networkx==3.1
- oauthlib==3.2.2
- opencv-python==4.8.0.74
- pandas==2.0.3
- pillow==10.0.0
- pluggy==1.2.0
- protobuf==4.23.4
- psutil==5.9.5
- pyarrow==12.0.1
- pyasn1==0.5.0
- pyasn1-modules==0.3.0
- pyparsing==3.0.9
- pytest==7.4.0
- python-dateutil==2.8.2
- pytz==2023.3
- pywavelets==1.4.1
- pyyaml==6.0
- qtpy==2.3.1
- requests-oauthlib==1.3.1
- rsa==4.9
- scikit-image==0.21.0
- seaborn==0.12.2
- six==1.16.0
- starfile==0.4.12
- sympy==1.12
- tensorboard==2.13.0
- tensorboard-data-server==0.7.1
- tifffile==2023.7.10
- torch==2.0.1
- torch-geometric==2.3.1
- torchvision==0.15.2
- tqdm==4.65.0
- tzdata==2023.3
- urllib3==1.26.16
- werkzeug==2.3.6
16 changes: 10 additions & 6 deletions examples/show_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@


DATA_PATH = Path(
"/Users/csoelistyo/Documents/grace_files/notebook_test/image_files"
# "/Users/csoelistyo/Documents/grace_files/notebook_test/image_files"
"/Users/kulicna/Desktop/classifier/data_fake/infer/padded"
)
IMAGE_PATH = (
DATA_PATH
/ "FoilHole_24680421_Data_24671727_24671728_20181024_2216-78563_noDW.mrc"
IMAGE_FILE = (
# "FoilHole_24680421_Data_24671727_24671728_20181024_2216-78563_noDW"
"MRC_Synthetic_File_000"
)
NODES_PATH = DATA_PATH / "data.h5"
IMAGE_PATH = DATA_PATH / f"{IMAGE_FILE}.mrc"
NODES_PATH = DATA_PATH / f"{IMAGE_FILE}.h5"


with mrcfile.open(IMAGE_PATH, "r") as mrc:
image_data = mrc.data.astype(int)
# image_data = mrc.data.astype(int)
image_data = mrc.data

nodes_data = pd.read_hdf(NODES_PATH)
points = np.asarray(nodes_data.loc[:, [GraphAttrs.NODE_Y, GraphAttrs.NODE_X]])
# features = {
Expand Down
5 changes: 5 additions & 0 deletions notebooks/run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
"json.dump(config.__dict__, open(CONFIG_FILE, 'w'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 9813117

Please sign in to comment.