Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Lint with pylint
run: |
pip install pylint
pylint --fail-under=9.8 --rcfile=.pylintrc utilities
pylint --fail-under=9.7 --rcfile=.pylintrc utilities
- name: code coverage
run: |
mkdir -p ./coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cd docs


sphinx-apidoc -e -M --force -o . ..
sphinx-apidoc -e -M --force -o . ../utilities/
make html
- name: Upload build data
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Note: you need to have a working ssh key to access github from your current mach
you need to have wheel installed.

```
python setup.py bdist_wheel sdist
pip wheel . --no-deps --wheel-dir=dist

```
After build run the following command to install, the built package.
Expand Down
57 changes: 40 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,64 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html


import datetime
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import toml

sys.path.insert(0, os.path.abspath(".."))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

def get_project_data():
try:
# Determine the path to pyproject.toml relative to this file
base_dir = os.path.dirname(os.path.abspath(__file__))
pyproject_path = os.path.join(base_dir, "..", "pyproject.toml")

# Load the pyproject.toml file
pyproject_data = toml.load(pyproject_path)

# Extract the version from the project section
metadata = dict(pyproject_data["project"])
except Exception as e:
metadata = "unknown"
return metadata


metadata = get_project_data()
year = datetime.datetime.now().year

project = 'GU Orbit Software Utilities'
copyright = '2023, GU Orbit Software Team'
author = 'GU Orbit Software Team'
release = '0.1.0'
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

if isinstance(metadata, dict):
project = f"GU Orbit Software {metadata['name']}"
copyright = f"{year}, {metadata['authors'][0]['name']}"
author = metadata['authors'][0]['name']
release = metadata["version"]
else:
raise TypeError(
"metadata must be a dict. There must be a problem with the pyproject.toml file."
)

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
add_module_names = False
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc"]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

#insegel theme
#furo theme
# insegel theme
# furo theme

html_theme = 'furo'
html_theme = "furo"


html_static_path = ['style']
html_css_files = ['custom.css']
html_static_path = ["style"]
html_css_files = ["custom.css"]
44 changes: 35 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
[tool.poetry]
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "utilities"
version = "0.1.0"
description = ""
authors = ["Jan-Loettgen <janlucaloettgen@gmail.com>"]
authors = [
{name = "GU Orbit Software Team", email = "uog.orbit@gmail.com"}
]
requires-python = ">=3.10"
description = "A package containing utilities for GU Orbit Software"
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
dependencies = [
"numpy >= 1.24.0",
"rasterio >= 1.3.6",
"Pillow >= 9.4.0",
"tensorflow >= 2.10",
"toml >= 0.10.2",
]

[tool.poetry.dependencies]
python = "^3.9"
[tool.setuptools]
packages = ["utilities"]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[project.optional-dependencies]
dev = [
"pytest >= 7.2.2",
"pytest-cov >= 4.0.0",
"pytest-mock >= 3.10.0",
"twine >= 4.0.0",

"Sphinx >= 6.1.3",
"furo >= 2022.12.7",
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ rasterio==1.3.6
Pillow==9.4.0
tqdm==4.64.1
pandas==1.5.1
toml==0.10.2
38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

22 changes: 22 additions & 0 deletions utilities/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os

import toml


def get_version_from_pyproject():
try:
# Determine the path to pyproject.toml relative to this file
base_dir = os.path.dirname(os.path.abspath(__file__))
pyproject_path = os.path.join(base_dir, "..", "pyproject.toml")

# Load the pyproject.toml file
pyproject_data = toml.load(pyproject_path)

# Extract the version from the project section
version = pyproject_data["project"]["version"]
except FileNotFoundError:
version = "unknown"
return version


__version__ = get_version_from_pyproject()
1 change: 1 addition & 0 deletions utilities/transform_utils/image_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import os

import numpy as np
from numpy.typing import NDArray
from PIL import Image
Expand Down