Skip to content

Commit

Permalink
feat(IBGE): continue work of AlertaDengue #192 (#193)
Browse files Browse the repository at this point in the history
* Started the implementation of fetching the population estimates from DATASUS

* Added missing path

* Fixed many bugs.
testing passing for sources POPTCU and projpop

* feat(IBGE): continue work of #192

* fix get_files from IBGEDATASUS

* finish get_population

* clean & update a the worflows

* fix tests

---------

Co-authored-by: Flávio Codeço Coelho <fccoelho@gmail.com>
  • Loading branch information
luabida and fccoelho committed Apr 16, 2024
1 parent 8f971c9 commit b3540d7
Show file tree
Hide file tree
Showing 17 changed files with 1,366 additions and 1,250 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/python-package.yml
Expand Up @@ -20,14 +20,9 @@ jobs:
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Prepare conda environment
run: |
sed -i s/python\ 3\.11/python\ ${{ matrix.python_version }}/ conda/dev.yaml
cat conda/dev.yaml
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
mamba-version: "*"
Expand All @@ -37,27 +32,11 @@ jobs:
use-mamba: true
miniforge-variant: Mambaforge


- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org/ | python -
export PATH="$HOME/.poetry/bin:$PATH"
poetry config virtualenvs.create false
- name: Install main dependencies
run: |
make conda-install-main ENVCREATE=conda-env
- name: Lint with flake8
run: |
make conda-install-dev
make check-codestyle
- name: Run jupyterlab with PySUS
run: |
make run-jupyter-pysus
- name: Test with pytest
run: |
make conda-install-geo
poetry install
make test-pysus
5 changes: 2 additions & 3 deletions .github/workflows/release.yaml
Expand Up @@ -16,9 +16,9 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
mamba-version: "*"
Expand Down Expand Up @@ -46,4 +46,3 @@ jobs:
run: |
poetry config pypi-token.pypi ${PYPI_TOKEN}
make release
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,4 +1,4 @@
.idea
.idea/
PySUS.egg-info/
build/
dist/
Expand Down
3 changes: 2 additions & 1 deletion .idea/PySUS.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 0 additions & 74 deletions Makefile
Expand Up @@ -36,42 +36,6 @@ SEMANTIC_RELEASE = npx --yes \
-p "semantic-release-replace-plugin" \
semantic-release


# Create a Conda environment and install dependencies for development.
.PHONY: conda-env
conda-env:
mamba env create -f conda/dev.yaml --force

# Install main project dependencies using Poetry.
.PHONY: conda-install-main
conda-install-main: ${ENVCREATE}
conda run -n pysus poetry install --only main

.PHONY: conda-install-dev
conda-install-dev:
conda run -n pysus poetry install --only dev

.PHONY: conda-install-docs
conda-install-docs:
conda run -n pysus poetry install --only docs

.PHONY: conda-install-geo
conda-install-geo:
conda run -n pysus pip install --no-use-pep517 shapely==1.8.5.post1
conda run -n pysus poetry install --only geo

# Linting
.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install

.PHONY: check-codestyle
check-codestyle: ## check style with flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

#* Docker basic
.PHONY: run-jupyter-pysus
run-jupyter-pysus: ## build and deploy all containers
Expand All @@ -91,44 +55,6 @@ test-pysus: ## run tests quickly with the default Python
cp docs/source/**/*.ipynb pysus/Notebooks
poetry run pytest -vv pysus/tests/

coverage: ## check code coverage quickly with the default Python
coverage run --source pysus/tests/ -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html

# Cleaning
.PHONY: clean
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

.PHONY: clean-build
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.cache' -exec rm -fr {} +
find . -name '*.jupyter' -exec rm -fr {} +
find . -name '*.local' -exec rm -fr {} +
find . -name '*.mozilla' -exec rm -fr {} +
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.ipynb_checkpoints' -exec rm -rf {} +

.PHONY: clean-pyc
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

.PHONY: clean-test
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache


# RELEASE
# =======

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -162,7 +162,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down

0 comments on commit b3540d7

Please sign in to comment.