Skip to content

Commit

Permalink
Merge pull request #6 from DroneML/1-python-template
Browse files Browse the repository at this point in the history
add content from python template
  • Loading branch information
cwmeijer authored Oct 8, 2024
2 parents 4d79ac8 + f35f399 commit e4be196
Show file tree
Hide file tree
Showing 29 changed files with 1,178 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changes here will be overwritten by Copier
SelectCitation:
- AddCitationFile_flag
- AddCFFConvert_flag
SelectCodeQualityFeatures:
- AddLocalTests_flag
- SelectGitHubActions_flag
- AddLinting_flag
SelectCommunityFeatures: []
SelectDocumentationFeatures:
- AddOnlineDocumentation_flag
- AddDevDoc_flag
- AddGitHubActionDocumentation_flag
SelectGitHubActions:
- AddGitHubActionBuild_flag
- AddLinkCheck_flag
SelectPublishReleaseFeatures:
- SelectCitation_flag
- AddZenodo_flag
_commit: 0.6.1
_src_path: https://github.com/nlesc/python-template.git
copyright_holder: Christiaan Meijer
email: [email protected]
full_name: Christiaan Meijer
github_organization: DroneML
keywords: Segmentation, UNet, Active learning, Drone, Raster data, Spatial data
license: Apachev2
package_name: segmentmytiff
package_short_description: Segment (georeferenced) raster data in an interactive fashion.
Retrain models in seconds. Only small amounts of labeled data necessary because
of our use of pretrained base models as feature extractors.
template_profile: ask
version: 0.1.0
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Python package

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

build:
name: Build for (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Python info
shell: bash -e {0}
run: |
which python
python --version
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[dev,publishing]
- name: Run unit tests
run: python -m pytest -v
- name: Verify that we can build the package
run: python -m build
lint:
name: Linting build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Python info
shell: bash -e {0}
run: |
which python
python --version
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[dev,publishing]
- name: Check style against standards using ruff
run: |
ruff check
ruff format --check
23 changes: 23 additions & 0 deletions .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: cffconvert

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

verify:
name: "cffconvert"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out a copy of the repository

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/[email protected]
with:
args: "--validate"
36 changes: 36 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: documentation

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-documentation:
name: Build documentation
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Python info
shell: bash -e {0}
run: |
which python
python --version
- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[dev,publishing]
- name: Install pandoc using apt
run: sudo apt install pandoc
- name: Build documentation
run: make coverage doctest html
working-directory: docs
38 changes: 38 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: link-check

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 1 * *' # first day of every month at midnight

permissions:
contents: read
issues: write

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1

- name: Set Issue Title
id: set_title
run: echo "ISSUE_TITLE=Link Checker Report - $(date '+%Y-%m-%d')" >> $GITHUB_ENV

- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: ${{ env.ISSUE_TITLE }}
content-filepath: ./lychee/out.md
labels: report, automated issue
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Byte-compiled / optimized / DLL files
*.py[cod]
*$py.class
__pycache__

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

# jupyter notebook
.ipynb_checkpoints

# Unit test / coverage reports
htmlcov/
.coverage
.coverage.*
coverage.xml
.cache
.pytest_cache
.tox/

# Sphinx documentation
docs/_build

# ide
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.spyderproject
.spyproject

# Mac
.DS_Store

# virtual environments
env
.env
env3
.env3
venv
.venv
venv3
.venv3
ENV/
env.bak/
venv.bak/

# vim
*.swp
*.swo
*.orig
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

7 changes: 7 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

7 changes: 7 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
python:
install:
- method: pip
path: .
extra_requirements:
- docs
19 changes: 19 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# YAML 1.2
---
cff-version: "1.2.0"
title: "segmentmytiff"
authors:
- family-names: Meijer
given-names: Christiaan
orcid: "https://orcid.org/0000-0000-0000-0000"
date-released: 2024-10-08
version: "0.1.0"
repository-code: "https://github.com/DroneML/segmentmytiff"
keywords:
- "Segmentation"
- " UNet"
- " Active learning"
- " Drone"
- " Raster data"
- " Spatial data"
message: "If you use this software, please cite it using these metadata."
Loading

0 comments on commit e4be196

Please sign in to comment.