-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various small fixes #211
Various small fixes #211
Changes from 10 commits
5f7c442
9b2880e
d5bf487
b554522
d4f3e12
bed530f
4d00075
8764278
b95fec0
d0a9c5b
6e378cb
ee7f267
f427ad0
08e5957
4466e00
a1613b0
a4c98ed
8fed1f1
7bccdf5
ded85d6
04d6f4a
307ce66
3fa75a4
628e6d8
47cb0a5
7deafab
3dd2daf
b22c0e9
21bd173
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build documentation and deploy | ||
name: "📚 Build documentation and deploy " | ||
|
||
on: | ||
workflow_dispatch: | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -435,3 +435,46 @@ def structured_grid( | |||||
properties=_vertex_data, | ||||||
name=name, | ||||||
) | ||||||
|
||||||
def project(self, xyz): | ||||||
"""Project a point into the bounding box | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
xyz : np.ndarray | ||||||
point to project | ||||||
|
||||||
Returns | ||||||
------- | ||||||
np.ndarray | ||||||
projected point | ||||||
""" | ||||||
|
||||||
return (xyz - self.global_origin) / np.max((self.global_maximum-self.global_origin))#np.clip(xyz, self.origin, self.maximum) | ||||||
|
||||||
def reproject(self, xyz): | ||||||
"""Reproject a point from the bounding box to the global space | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
xyz : np.ndarray | ||||||
point to reproject | ||||||
|
||||||
Returns | ||||||
------- | ||||||
np.ndarray | ||||||
reprojected point | ||||||
""" | ||||||
|
||||||
return xyz * np.max((self.global_maximum - self.global_origin)) + self.global_origin | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using np.max for reprojection might be incorrect for non-uniform bounding boxes. Consider using element-wise multiplication instead: xyz * (self.global_maximum - self.global_origin) + self.global_origin.
Suggested change
Copilot is powered by AI, so mistakes are possible. Review output carefully before use. |
||||||
|
||||||
def __repr__(self): | ||||||
return f"BoundingBox({self.origin}, {self.maximum}, {self.nsteps})" | ||||||
|
||||||
def __str__(self): | ||||||
return f"BoundingBox({self.origin}, {self.maximum}, {self.nsteps})" | ||||||
|
||||||
def __eq__(self, other): | ||||||
if not isinstance(other, BoundingBox): | ||||||
return False | ||||||
return np.allclose(self.origin, other.origin) and np.allclose(self.maximum, other.maximum) and np.allclose(self.nsteps, other.nsteps) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ RUN apt-get update -qq && \ | |
libgl1-mesa-glx\ | ||
xvfb | ||
RUN conda install -c conda-forge\ | ||
-c loop3d\ | ||
# python"<=3.8"\ | ||
cython\ | ||
numpy\ | ||
|
@@ -32,9 +33,11 @@ RUN conda install -c conda-forge\ | |
meshio\ | ||
python=3.10\ | ||
pydata-sphinx-theme\ | ||
pyvista\ | ||
loopstructuralvisualisation\ | ||
-y | ||
RUN pip install git+https://github.com/geopandas/[email protected] | ||
RUN pip install loopstructuralvisualisation[all] geoh5py | ||
RUN pip install geoh5py | ||
RUN pip install sphinxcontrib-bibtex | ||
ENV TINI_VERSION v0.19.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
{ | ||
"packages": { | ||
"LoopStructural": { | ||
"release-type": "python", | ||
"types": ["feat", "fix"], | ||
"bump-minor-pre-major": true, | ||
"bump-minor-pre-major-pattern": "feat", | ||
"bump-patch-for-minor-pre-major": true, | ||
"bump-patch-for-minor-pre-major-pattern": "fix", | ||
"include-v-in-tag": true | ||
"release-type": "python" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using np.max for projection might be incorrect for non-uniform bounding boxes. Consider using element-wise division instead: (xyz - self.global_origin) / (self.global_maximum - self.global_origin).
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.