Skip to content

Commit

Permalink
Make package
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsdukai committed Sep 5, 2023
1 parent f55d052 commit 2c81d08
Show file tree
Hide file tree
Showing 19 changed files with 92 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ dmypy.json
cython_debug/

.vscode/
.idea

*.csv
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

## Installation

You need to install all dependencies first:
Install the package from the repository:

```
pip install -r requirements.txt
cd urban-morphology-3d
pip install .
```

Then take your time and install [pymesh](https://pymesh.readthedocs.io/en/latest/installation.html).
Expand Down
76 changes: 76 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[build-system]
requires = ["setuptools>=65.3"]
build-backend = "setuptools.build_meta"

[project]
name = "urban-morphology-3d"
version = "2023.1001"
description = "3D Building Metrics"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"attrs==23.1.0",
"certifi==2023.5.7",
"charset-normalizer==3.2.0",
"click==8.1.6",
"click-plugins==1.1.1",
"cligj==0.7.2",
"contourpy==1.1.0",
"cycler==0.11.0",
"Cython==3.0.0",
"Fiona==1.9.4.post1",
"fonttools==4.41.0",
"geopandas==0.13.2",
"idna==3.4",
"importlib-metadata==6.8.0",
"importlib-resources==6.0.0",
"joblib==1.3.1",
"kiwisolver==1.4.4",
"mapbox-earcut==1.0.1",
"matplotlib==3.7.2",
"miniball==1.2.0",
"numpy==1.24.4",
"packaging==23.1",
"pandas==2.0.3",
"Pillow==10.0.0",
"platformdirs==3.9.1",
"pooch==1.7.0",
"pymeshfix==0.16.2",
"pyparsing==3.0.9",
"pyproj==3.5.0",
"python-dateutil==2.8.2",
"pytz==2023.3",
"pyvista==0.37.0",
"requests==2.31.0",
"Rtree==1.0.1",
"scikit-learn==1.3.0",
"scipy==1.10.1",
"scooby==0.7.2",
"shapely==2.0.1",
"six==1.16.0",
"threadpoolctl==3.2.0",
"tqdm==4.65.0",
"tzdata==2023.3",
"urllib3==2.0.4",
"vtk==9.2.6",
"zipp==3.16.2",
"pgutils @ git+https://github.com/balazsdukai/[email protected]#egg=pgutils",
]
optional-dependencies = { dev = ["bumpver", "tox",] }

[tool.setuptools.packages.find]
where = ["src"]

[tool.bumpver]
current_version = "2022.1001"
version_pattern = "YYYY.BUILD"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'version = "{version}"',
]

46 changes: 0 additions & 46 deletions requirements.txt

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions cityCompare.py → src/urban_morphology_3d/cityCompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import json
import numpy as np
from tqdm import tqdm
import cityjson
from helpers.mesh import difference, symmetric_difference, to_pymesh, to_pyvista, intersect
from urban_morphology_3d import cityjson
from urban_morphology_3d.helpers.mesh import difference, symmetric_difference, to_pymesh, to_pyvista, intersect
import pyvista as pv
import pandas as pd
import pymesh
Expand Down
2 changes: 1 addition & 1 deletion cityPlot.py → src/urban_morphology_3d/cityPlot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import click
import json
import numpy as np
from cityjson import to_triangulated_polydata
from urban_morphology_3d.cityjson import to_triangulated_polydata
import pyvista as pv
from tqdm import tqdm

Expand Down
4 changes: 2 additions & 2 deletions cityStats.py → src/urban_morphology_3d/cityStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from pgutils import PostgresConnection
from psycopg import sql

import cityjson
import geometry
from urban_morphology_3d import cityjson
from urban_morphology_3d import geometry

def get_bearings(values, num_bins, weights):
"""Divides the values depending on the bins"""
Expand Down
2 changes: 1 addition & 1 deletion cityjson.py → src/urban_morphology_3d/cityjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from shapely.geometry import Polygon, MultiPolygon
from helpers.geometry import project_2d, surface_normal, triangulate, triangulate_polygon
from urban_morphology_3d.helpers.geometry import project_2d, surface_normal, triangulate, triangulate_polygon
import pyvista as pv

def get_surface_boundaries(geom):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion geometry.py → src/urban_morphology_3d/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pyvista as pv
from helpers.geometry import plane_params, project_mesh, to_3d
from urban_morphology_3d.helpers.geometry import plane_params, project_mesh, to_3d
from scipy.spatial import distance_matrix
from sklearn.cluster import AgglomerativeClustering
from shapely import intersects, Polygon
Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions shape_index.py → src/urban_morphology_3d/shape_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import math
from shapely.geometry import Point, MultiPoint, Polygon
from helpers.geometry import surface_normal
from urban_morphology_3d.helpers.geometry import surface_normal
try:
from helpers.mesh import to_pymesh, to_pyvista, intersect
from urban_morphology_3d.helpers.mesh import to_pymesh, to_pyvista, intersect
pymesh_exists = True
except:
print("WARNING: pymesh not found! Exchange index calculation will be omitted...")
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tox]
envlist = py38
isolated_build = True

0 comments on commit 2c81d08

Please sign in to comment.