Skip to content

Commit

Permalink
Move package into src dir (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykironde authored Nov 19, 2024
1 parent def50b9 commit fdfd55f
Show file tree
Hide file tree
Showing 55 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "1.4.2-dev0"
current_version = "1.4.2"

parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
Expand Down Expand Up @@ -38,4 +38,4 @@ commit_args = ""
filename = "pyproject.toml"

[[tool.bumpversion.files]]
filename = "deepforest/_version.py"
filename = "src/deepforest/_version.py"
7 changes: 5 additions & 2 deletions .github/workflows/Conda-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ jobs:
cache-environment: true
cache-downloads: true

- name: Install package
run: pip install . -U

- name: Run pytest
run: pytest -v

- name: Check style
run: yapf -d --recursive deepforest/ --style=.style.yapf
run: yapf -d --recursive src/deepforest/ --style=.style.yapf

- name: Check notebook style
run: nbqa yapf --in-place docs/user_guide/examples/*.ipynb --style=.style.yapf
Expand All @@ -59,7 +62,7 @@ jobs:
run: pytest --nbmake docs/**/*_test.ipynb

- name: Run docformatter
run: docformatter --check --recursive deepforest/
run: docformatter --check --recursive src/deepforest/

- name: Test Docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
- id: yapf
name: yapf
entry: yapf
args: ['-i', '--style', '.style.yapf', '--recursive', 'deepforest/']
args: ['-i', '--style', '.style.yapf', '--recursive', 'src/deepforest/']
language: system
types: [python]
pass_filenames: false
Expand All @@ -16,7 +16,7 @@ repos:
entry: docformatter
language: python
types: [python]
args: ['--in-place', '--recursive','deepforest/']
args: ['--in-place', '--recursive','src/deepforest/']
pass_filenames: false
stages: [commit]

4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can also run yapf from the command line to cleanup the style in your changes

.. code-block:: bash
yapf -i --recursive deepforest/ --style=.style.yapf
yapf -i --recursive src/deepforest/ --style=.style.yapf
If the style tests fail on a pull request, running the above command is the easiest way to fix this.

Expand Down Expand Up @@ -128,7 +128,7 @@ We use `Docformatter <https://pypi.org/project/docformatter/>`_ for formatting a

.. code-block:: bash
$ docformatter --in-place --recursive deepforest/
$ docformatter --in-place --recursive src/deepforest/
Update Documentation
^^^^^^^^^^^^^^^^^^^^
Expand Down
7 changes: 6 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
DeepForest Changelog
====================

Version 1.4.0 (Date: Oct 9, 2024)
Version 1.4.1 (Date: Oct 26, 2024)
----------------------------------

- **Enhancement:** Use GitHub Actions to publish the package.

Version 1.4.0 (Date: Oct 9, 2024)
---------------------------------

The major innovations are

1. New model loading framework using HuggingFace. DeepForest models are now available on https://huggingface.co/weecology. The models can be loaded using load_model() and used for inference.
Expand Down
28 changes: 14 additions & 14 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
include deepforest/data/deepforest_config.yml
include deepforest/data/testfile_deepforest.csv
include deepforest/data/testfile_multi.csv
include deepforest/data/classes.csv
include deepforest/data/OSBS_029*
include deepforest/data/SOAP_031*
include deepforest/data/SOAP_061*
include deepforest/data/2019_YELL_2_541000_4977000_image_crop.xml
include deepforest/data/2019_YELL_2_541000_4977000_image_crop.png
include deepforest/data/2019_YELL_2_528000_4978000_image_crop2.xml
include deepforest/data/2019_YELL_2_528000_4978000_image_crop2.png
include deepforest/data/AWPE*
include deepforest/data/example.csv
include deepforest/data/test_tiled.tif

include src/deepforest/data/deepforest_config.yml
include src/deepforest/data/testfile_deepforest.csv
include src/deepforest/data/testfile_multi.csv
include src/deepforest/data/classes.csv
include src/deepforest/data/OSBS_029*
include src/deepforest/data/SOAP_031*
include src/deepforest/data/SOAP_061*
include src/deepforest/data/2019_YELL_2_541000_4977000_image_crop.xml
include src/deepforest/data/2019_YELL_2_541000_4977000_image_crop.png
include src/deepforest/data/2019_YELL_2_528000_4978000_image_crop2.xml
include src/deepforest/data/2019_YELL_2_528000_4978000_image_crop2.png
include src/deepforest/data/AWPE*
include src/deepforest/data/example.csv

include LICENSE
include dev_requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Version](https://img.shields.io/pypi/v/DeepForest.svg)](https://pypi.python.org/pypi/DeepForest)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/deepforest)](https://pypi.python.org/pypi/DeepForest)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2538143.svg)](https://doi.org/10.5281/zenodo.2538143)
[![Python Version](https://img.shields.io/badge/python-%3E%3D3.5%2C%20%3C3.13-blue.svg)](https://www.python.org/downloads/)
[![Python Version](https://img.shields.io/badge/python-%3E%3D3.8%2C%20%3C3.13-blue.svg)](https://www.python.org/downloads/)

### Conda-forge build status

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires = [

[project]
name = "deepforest"
version = "1.4.2-dev0"
version = "1.4.2"
description = "Tree crown prediction using deep learning retinanets"
readme = "README.md"
license = { text = "MIT" }
Expand Down Expand Up @@ -73,6 +73,6 @@ dependencies = [
"tqdm",
"xmltodict",
]
[tool.setuptools]
packages = ["deepforest"]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deepforest/_version.py → src/deepforest/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.4.2-dev0'
__version__ = '1.4.2'
# Version updated using bump-my-version
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion deepforest/predict.py → src/deepforest/predict.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Prediction utilities
import cv2
import pandas as pd
import numpy as np
import os
Expand Down
2 changes: 0 additions & 2 deletions deepforest/preprocess.py → src/deepforest/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import warnings
import rasterio
import geopandas as gpd
from shapely import geometry
import geopandas as gpd
from deepforest.utilities import read_file, determine_geometry_type
from shapely import geometry

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Fixtures model to only download model once
# download latest release
import pytest
from deepforest import utilities, main
from deepforest import main
from deepforest import utilities
from deepforest import get_data
from deepforest import _ROOT
import os
Expand All @@ -12,8 +13,7 @@

@pytest.fixture(scope="session")
def config():
config = utilities.read_config("{}/deepforest_config.yml".format(
os.path.dirname(_ROOT)))
config = utilities.read_config(get_data("deepforest_config.yml"))
config["fast_dev_run"] = True
config["batch_size"] = True
return config
Expand Down
5 changes: 0 additions & 5 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,3 @@ def test_get_data():
assert os.path.exists(deepforest.get_data("classes.csv"))


# Assert that the included config file matches the front of the repo.
def test_matching_config(ROOT):
config = read_config("{}/deepforest_config.yml".format(os.path.dirname(ROOT)))
config_from_data_dir = read_config("{}/data/deepforest_config.yml".format(ROOT))
assert config == config_from_data_dir
3 changes: 2 additions & 1 deletion tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import geopandas as gpd

from deepforest import get_data
from deepforest import utilities, visualize
from deepforest import visualize
from deepforest import utilities
from deepforest import main

# import general model fixture
Expand Down

0 comments on commit fdfd55f

Please sign in to comment.