-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Vizzuality/sofia_data
add data folder
- Loading branch information
Showing
14 changed files
with
3,640 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
charset = utf-8 | ||
end_of_line = lf | ||
|
||
[*.bat] | ||
indent_style = tab | ||
end_of_line = crlf | ||
|
||
[LICENSE] | ||
insert_final_newline = false | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.py] | ||
profile = black | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
|
||
[*.yaml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# DotEnv configuration | ||
.env | ||
*/*.env | ||
|
||
# Database | ||
*.db | ||
*.rdb | ||
|
||
# Pycharm | ||
.idea | ||
|
||
# VS Code | ||
.vscode/ | ||
|
||
# Spyder | ||
.spyproject/ | ||
|
||
# Jupyter NB Checkpoints | ||
.ipynb_checkpoints/ | ||
|
||
# exclude data from source control by default | ||
/data/ | ||
|
||
# Mac OS-specific storage files | ||
.DS_Store | ||
|
||
# vim | ||
*.swp | ||
*.swo | ||
|
||
# Mypy cache | ||
.mypy_cache/ | ||
|
||
.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.275 | ||
hooks: | ||
- id: ruff | ||
args: [ "--line-length=100", "--select=E,F,N"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
args: [ "--line-length=100" ] | ||
|
||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.7.0 | ||
hooks: | ||
- id: nbqa-black | ||
args: [ "--line-length=100", "--check"] | ||
- id: nbqa-isort | ||
args: [ "--float-to-top", "--profile=black", "--check-only"] | ||
- id: nbqa-ruff | ||
args: [ "--line-length=100" , "--select=E,F,N"] | ||
|
||
# check for private keys and passwords! | ||
- repo: https://github.com/gitleaks/gitleaks | ||
rev: v8.16.1 | ||
hooks: | ||
- id: gitleaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
|
||
## v0.1.0 | ||
|
||
Unreleased | ||
|
||
### Added | ||
|
||
### Changed | ||
|
||
### Fixed | ||
|
||
### Removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM mambaorg/micromamba:1.4.4 | ||
|
||
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml | ||
|
||
RUN micromamba install -n base --yes --file /tmp/environment.yml && \ | ||
micromamba clean --all --yes | ||
|
||
# TODO: export .env in here | ||
|
||
# Otherwise python will not be found | ||
ARG MAMBA_DOCKERFILE_ACTIVATE=1 | ||
|
||
# Jupyter with Docker Compose | ||
EXPOSE 8888 | ||
WORKDIR /home/$MAMBA_USER | ||
|
||
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh", "jupyter", "lab", "--ip=0.0.0.0","--allow-root", "--no-browser"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2023, Vizzuality | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
skytruth_30x30 | ||
============================== | ||
|
||
Develop an MVP platform that tracks country progress towards global protection 30% of oceans by 2030 | ||
|
||
-------- | ||
|
||
## Setup | ||
|
||
### The environment | ||
To run the notebooks you need to create an environment with the dependencies. There are two options: | ||
#### Docker | ||
|
||
If you have [docker](https://docs.docker.com/engine/install/) in your system, | ||
you run a jupyter lab server with: | ||
|
||
``` bash | ||
docker compose up --build | ||
``` | ||
|
||
And if you want to get into the container, use a terminal in jupyter lab, | ||
vscode remote development or run this command: | ||
|
||
```shell | ||
docker exec -it skytruth_notebooks /bin/bash | ||
``` | ||
|
||
#### Conda environment | ||
|
||
Create the environment with: | ||
|
||
``` bash | ||
mamba env create -n skytruth_30x30 -f environment.yml | ||
``` | ||
This will create an environment called skytruth_30x30 with a common set of dependencies. | ||
|
||
### `git` (if needed) and pre-commit hooks | ||
|
||
If this project is a new and standalone (not a module in a bigger project), you need to initialize git: | ||
|
||
``` bash | ||
git init | ||
``` | ||
|
||
If the project is already in a git repository, you can skip this step. | ||
|
||
To install the **pre-commit hooks**, with the environment activated and in the project root directory, run: | ||
|
||
``` bash | ||
pre-commit install | ||
``` | ||
|
||
## Update the environment | ||
|
||
If you need to update the environment installing a new package, you simply do it with: | ||
|
||
``` bash | ||
mamba install [package] # or `pip install [package]` if you want to install it via pip | ||
``` | ||
|
||
then update the environment.yml file so others can clone your environment with: | ||
|
||
``` bash | ||
mamba env export --no-builds -f environment.yml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3.8' | ||
services: | ||
skytruth-notebooks: | ||
build: | ||
context: . | ||
volumes: | ||
- ./data:/home/mambauser/data | ||
- ./notebooks:/home/mambauser/notebooks | ||
- ./src:/home/mambauser/src | ||
ports: | ||
- 8888:8888 | ||
- 8787:8787 # dask dashboard | ||
container_name: skytruth_notebooks | ||
env_file: .env |
Oops, something went wrong.