Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
# Ignores `.ipynb` files, `_build` and `_static` folders
Expand Down
15 changes: 15 additions & 0 deletions dev_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
conda install numpy
conda install pandas
conda install matplotlib
conda install -c conda-forge obspy
conda install -c conda-forge fsspec
conda install black
conda install -c conda-forge check-manifest
conda install flake8
conda install -c conda-forge isort
conda install numpydoc
conda install -c conda-forge pre_commit
conda install -c conda-forge pylint
python ooipy/setup.py
conda develop ooipy
python ooipy/verify_setup.py
38 changes: 38 additions & 0 deletions docs/source/install_instructions.rst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably run verify_setup.py within the bash script.

And it might even be possible to check if the python path is the local directory within the python script, and then just print something like
'Development environment installation successful'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anishdixit-uw, would you be able to add these changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@John-Ragland verify_setup.py already runs from within the bash script.

And it does print out the path of OOIPY installation, so is that what you are saying here or something different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could we change name lines for creating the environment to have the environment name be ooipy_dev?

conda create --name ooipy_dev

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@John-Ragland for now I assumed that the environment is already created, then the user clones the repo and then runs the bash script.

If we want to give in environment creation instructions ourselves, the documentation will have to be changed, so the new order would be:

  1. Clone repo
  2. Run bash script (env gets automatically created)

If this logic makes sense, I can make the changes, should be easily doable

Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,41 @@ OOIPY is designed to run on Python 3.8.5. To install OOIPY, run the following co
pip install ooipy

Please see our Getting Started Guide for a tutorial on basic OOIPY usage.


How to setup OOIPY development environment
==========================================

1. Navigate into the folder where you wish to setup ooipy and clone the repository using this command:

.. code-block :: bash

git clone https://github.com/Ocean-Data-Lab/ooipy.git

2. Setup a new Conda environment using this command:

.. code-block :: bash

conda create --name env_name

3. Activate the environment using this command:

.. code-block :: bash

source activate env_name

4. Run the script to setup the development environment and install dependencies using this command:

.. code-block :: bash

bash ooipy/dev_setup.sh

Conda will ask for permissions while installing each library, answer 'y' to each.

5. When this runs successfully, run the python file to verify if installation is proper, using this command:

.. code-block :: bash

python ooipy/verify_setup.py

If the path printed out matches your local installation path for the ooipy github repository, your development environment has been properly setup.
4 changes: 4 additions & 0 deletions verify_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ooipy

print("PATH TO OOIPY INSTALLATION")
print(ooipy.__file__)