Installation¶
Note
Python must already be installed in your current working environment. Instructions to create a new environment for planetsca are available here.
Attention
For data access, you must have an API key from Planet.
Installing with pip¶
To install the package, use
pip install --extra-index-url https://test.pypi.org/simple planetsca
Setting up an environment¶
Setting up a conda environment in the terminal¶
Find detailed instructions here.
Open a terminal
Create a new environment called “planetenv” with python version 3.8 or greater:
conda create -n planetenv python=3.9
Activate your new environment:
conda activate planetenv
Install planetsca from pip
pip install --extra-index-url https://test.pypi.org/simple planetsca
To use jupyter notebooks with this conda environment:
Activate your new environment:
conda activate planetenv
Install ipykernel:
pip install --user ipykernel
Connect this environment to notebooks:
python -m ipykernel install --user --name=planetenv
When you start a jupyter notebook, you can now select the
planetenv
environment kernel
Setting up a Virtual Environment (VENV) on VSCode¶
Creating a VENV is recommended for this project as it ensures that there are no package conflicts and that troubleshooting is much easier. The following instructions are summarized from [here](https://code.visualstudio.com/docs/python/environments).
Open Command Palette (Ctrl + Shift + P)
Select Venv
Select Desired Interpreter Path (I use 3.12.2, minimum version is 3.8)
Notification should show up on the bottom right corner titled “Creating environment (Show logs): Creating venv…
The venv is set up and activated if you see “ _Python Version_ (.’venv’:venv)”
Note
After setting up a venv once, VScode will automatically start up the virtual environment alongside with VScode. There is no need to repeat these steps unless you do not see step 5.
More information on using environments in VScode is available here
Installing for contributors¶
We welcome new contributions, improvements, and bug fixes! New features and ideas for the package within the scope of snow remote sensing using Planet imagery are also welcome. Please create an issue to discuss a new feature of bug fix.
To contribute code addressing new features or bug fixes, follow these steps:
Clone the repository (or a fork of the repository)
git clone https://github.com/DSHydro/planetsca.git
Go to the repository
cd planetsca
Install the development version of planetsca
pip install -e ".[dev]"
Setup pre-commit
pre-commit install
Create a feature branch with a descriptive name (e.g.
bug-fix-planet-api-change
). This command will also switch you to this new branch.
git checkout -b new-branch-name
After making your changes, run pre-commit before pushing those changes to your new branch (example below)
git add your_updated_file_here.py
pre-commit
.
.
.
git commit -m 'Bug fixes for planet api change'
git push -u origin bug-fix-planet-api-change
Then submit a pull request (PR) from the feature branch of your fork to
DSHydro/planetsca:main
The PR will be reviewed by at least one maintainer, discussed, then merged
Additional information¶
This package was developed from code by Kehan Yang
Check out the package on TestPyPi: PyPi
Pre-trained Models hosted on Hugging Face: Models
Sample Data hosted on Hugging Face: Data
Find your API Key for accessing Planet imagery: Planet