Skip to content

Commit

Permalink
Merge pull request #18 from AgPipeline/develop
Browse files Browse the repository at this point in the history
Updating master with develop - no review
  • Loading branch information
Chris-Schnaufer authored Jul 30, 2020
2 parents 6314762 + 2d88a29 commit febe337
Show file tree
Hide file tree
Showing 11 changed files with 376 additions and 318 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/action_pylint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cp ./.github/workflows/*.py ./

82 changes: 82 additions & 0 deletions .github/workflows/pylint_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Enforcing pylint checks
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
tags:
- v*

jobs:
update_python:
runs-on: ubuntu-latest
name: Running pylint checks
steps:
- name: Current python version
run: python3 --version || echo python3 not installed
- name: Install Python 3.7
run: sudo apt-get install -y --no-install-recommends python3.7 python3-pip && sudo ln -sfn /usr/bin/python3.7 /usr/bin/python3
id: install_python_3_7
- name: Updated python version
run: python3 --version
- name: PYTHONPATH environment variable
run: echo ${PYTHONPATH}
- name: Update pip
run: python3 -m pip install --upgrade --no-cache-dir pip
id: pip-install
- name: Fetch/update setuptools
run: python3 -m pip install --upgrade --no-cache-dir setuptools
id: setuptools-install
- name: Install python-apt
run: sudo apt-get install -y python-apt
- name: HACK to fix apt-get update problem w/ different python versions
run: 'cd /usr/lib/python3/dist-packages && sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.so'
- name: Update apt-get
run: sudo apt-get update
- name: Fetch/update pylint
run: python3 -m pip install --upgrade --no-cache-dir pylint
id: pylint-install
- name: Fetch source code
uses: actions/checkout@v2
id: fetch-source
- name: Finding files
run: find . -type f -name "*.py" > action_pylint_files.txt
id: find-python-files
- name: Install system requirements
shell: bash
run: 'sudo apt-get install -y python3-gdal gdal-bin libgdal-dev gcc g++ python3.7-dev'
id: install-gdal-other-reqs
- name: Install Python numpy
shell: bash
run: 'python3 -m pip install --upgrade --no-cache-dir numpy wheel terrautils'
id: install-python-numpy
- name: Install Python pygdal
shell: bash
run: 'sudo python3 -m pip install --no-cache-dir pygdal==2.2.3.5'
id: install-python-pygdal
- name: Install system requirements from source
shell: bash
run: '[ -s "packages.txt" ] && (cat packages.txt | xargs apt-get install -y --no-install-recommends) || (echo "No addtional packages to install")'
id: install-system-reqs
- name: Install Python requirements from source
shell: bash
run: '[ -s "requirements.txt" ] && (python3 -m pip install --no-cache-dir -r requirements.txt) || (echo "No Python packages to install")'
id: install-python-reqs
- name: Run action pylint script
shell: bash
run: '[ -s ".github/workflows/action_pylint.sh" ] && (chmod +x ".github/workflows/action_pylint.sh" && ./.github/workflows/action_pylint.sh) || (echo "Error running shell script")'
id: run-special-action-script
- name: Fetching pylint.rc file
run: wget https://raw.githubusercontent.com/AgPipeline/Organization-info/master/pylint.rc
id: fetch_pylint_resource
- name: Listing
run: ls -la
- name: Files to be linted
run: cat action_pylint_files.txt
- name: Running pylint
run: cat action_pylint_files.txt | xargs python3 -m pylint --rcfile ./pylint.rc --extension-pkg-whitelist=cv2

113 changes: 111 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,111 @@
.idea/*
*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# pycharm
.idea

# Testing folder
test

10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM FROM agdrone/drone-base-image:1.2
FROM agdrone/agpypeline:1.0
LABEL maintainer="Chris Schnaufer <[email protected]>"

# Start installing things
COPY requirements.txt packages.txt /home/extractor/

USER root
Expand All @@ -26,5 +27,10 @@ RUN [ -s /home/extractor/requirements.txt ] && \
rm /home/extractor/requirements.txt)

USER extractor
COPY configuration.py soilmask.py /home/extractor/

COPY configuration.py transformer.py /home/extractor/
USER root
RUN chmod a+x /home/extractor/soilmask.py

USER extractor
ENTRYPOINT ["/home/extractor/soilmask.py"]
26 changes: 0 additions & 26 deletions Dockerfile.template

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ Note that the paths provided are relative to the running image (see the --mount
- `--working_space "/mnt"` specifies the folder to use as a workspace
- `--metadata "/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_metadata.cleaned.json"` is the name of the source metadata to be cleaned
- `"/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_left.tif"` is the name of the image to mask

43 changes: 25 additions & 18 deletions configuration.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
"""Contains transformer configuration information
"""
from agpypeline.configuration import Configuration

# The version number of the transformer
TRANSFORMER_VERSION = '2.0'

# The transformer description
TRANSFORMER_DESCRIPTION = 'Stereo RGB Image Enhancement & Masking'
class ConfigurationSoilmask(Configuration):
"""Configuration information for Soil Mask transformer"""
# Silence this error until we have public methods
# pylint: disable=too-few-public-methods

# Short name of the transformer
TRANSFORMER_NAME = 'terra.stereo-rgb.rgbmask'
# The version number of the transformer
transformer_version = '2.0'

# The name of the author of the extractor
AUTHOR_NAME = 'Chris Schnaufer'
# The transformer description
transformer_description = 'Stereo RGB Image Enhancement & Masking'

# The email of the author of the extractor
AUTHOR_EMAIL = '[email protected]'
# Short name of the transformer
transformer_name = 'terra.stereo-rgb.rgbmask'

# Reposity URI of where the source code lives
REPOSITORY = 'https://github.com/Chris-Schnaufer/rgbmask.git'
# The name of the author of the extractor
author_name = 'Chris Schnaufer'

# Contributors to this transformer
CONTRUBUTORS = ['Max Burnette', 'Zongyang Li', 'Todd Nicholson']
# The email of the author of the extractor
author_email = '[email protected]'

# The sensor associated with the transformer
TRANSFORMER_SENSOR = 'stereoTop'
# Repository URI of where the source code lives
repository = 'https://github.com/Chris-Schnaufer/rgbmask.git'

# The transformer type (eg: 'rgbmask', 'plotclipper')
TRANSFORMER_TYPE = 'rgb_mask'
# Contributors to this transformer
contributors = ['Max Burnette', 'Zongyang Li', 'Todd Nicholson']

# The sensor associated with the transformer
transformer_sensor = 'stereoTop'

# The transformer type (eg: 'rgbmask', 'plotclipper')
transformer_type = 'rgb_mask'
69 changes: 0 additions & 69 deletions generate_docker.py

This file was deleted.

5 changes: 1 addition & 4 deletions packages.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
libsm6
libxext6
libxrender1
libglib2.0-0

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
scikit-image
opencv-python
agpypeline

Loading

0 comments on commit febe337

Please sign in to comment.