I realized while leading an online workshop that many folks were not sure how to clone a repository in terminal. Here is a brief intro with the caveat that I am on a macOS Apple M4 Pro.
I found an interesting dataset in an article, An operational approach to near real time global high resolution mapping of the terrestrial Human Footprint. The data and scripts used are found in the gitlab repository.
In Terminal I have a minimal_ds environment created from this article, written by Teddy Petrou. I learned from Ted live and in person in combination with the endless resources he provides. He is definitely worth a follow.
We need to activate our environment and then clone the repository (see earlier screenshot).
MacBook-Pro-3:~ bonnymcclain$ conda activate minimal_ds (minimal_ds) MacBook-Pro-3:~ bonnymcclain$ git clone git@gitlab.com:impactobservatory/dwi-humanfootprint.git
Now that we have the repository on our local computer we can locate the current directory and see what it contains by executing “ls”.
(minimal_ds) MacBook-Pro-3:~ bonnymcclain$ cd dwi-humanfootprint
(minimal_ds) MacBook-Pro-3:dwi-humanfootprint bonnymcclain$ ls
LICENSE.md
main.py src
README.md
notebooks
dockerfile
requirements.txt
(minimal_ds) MacBook-Pro-3:dwi-humanfootprint bonnymcclain$ python3 main.py
In order to interact with the files in your directory you will need to use a text editor. I use nano or Spyder if I want the IDE experience.
brew install nano
nano my_script.py
pip install -r requirements.txt
To see what is inside the requirements.txt you can use the ‘cat’ command.
(minimal_ds) MacBook-Pro-3:dwi-humanfootprint bonnymcclain$ cat requirements.txt
numpy==1.20.1 pyproj==3.1.0 rasterio==1.2.10 morecantile==2.1.0 rio_tiler==2.0.7 mahotas==1.4.11 sat-stac==0.4.1 click==7.1.2 cog_worker==0.1.3 scipy==1.6.3 azure-storage-blob==12.8.1 matplotlib==3.4.2
Now you can see what is inside the notebooks or any other file …
(minimal_ds) MacBook-Pro-3:dwi-humanfootprint bonnymcclain$ ls notebooks
0. Planetary computer hub execute.ipynb 3. Calc stats by biome.ipynb hfp_validation.geojson
1. HFP validation.ipynb fig_pts2.geojson
2. Figures.ipynb hfp2013_merisINT.tif
I hope you found this helpful!