Skip to content

Commit

Permalink
Merge pull request #33 from ariostas/main
Browse files Browse the repository at this point in the history
Upgraded to Python 3.11
  • Loading branch information
natemacfadden authored Jan 1, 2024
2 parents 5a020ed + 7cfadc7 commit 46fe02a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start from Debian Bullseye
FROM debian:bullseye
FROM python:3.11-bullseye

# Define build arguments
ARG USERNAME
Expand All @@ -19,8 +19,8 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get -yqq install autoconf build-essential nano cmake libgmp-dev libcgal-dev\
libmpc-dev libsuitesparse-dev libppl-dev libeigen3-dev\
libc6 libcdd0d libgmp10 libgmpxx4ldbl libstdc++6 palp\
libflint-dev libflint-arb-dev python3 python3-pip curl\
wget libmath-libm-perl python3-venv normaliz libqsopt-ex2
libflint-dev libflint-arb-dev curl\
wget libmath-libm-perl normaliz libqsopt-ex2

# Make a soft link to the arb library and flint headers so that python-flint can install
RUN ln -s /usr/lib/${AARCH}-linux-gnu/libflint-arb.so /usr/lib/${AARCH}-linux-gnu/libarb.so
Expand Down Expand Up @@ -69,7 +69,7 @@ RUN if [ "$OPTIONAL_PKGS" = "1" ]; then \

# Fix cvxopt bug
USER root
RUN sed -i -e 's/mosek.solsta.near_optimal/ /g' $VIRTUAL_ENV/lib/python3.9/site-packages/cvxopt/coneprog.py
RUN sed -i -e 's/mosek.solsta.near_optimal/ /g' $VIRTUAL_ENV/lib/python3.11/site-packages/cvxopt/coneprog.py

# Install TOPCOM
WORKDIR /opt/cytools/external/topcom-mod
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ build:
else \
notify-send "CYTools" "The CYTools image has started building. We'll notify you once it's done :)" || echo ""; \
fi
sudo docker pull debian:bullseye
sudo docker pull python:3.11-bullseye
sudo docker build --no-cache --force-rm -t cytools:uid-$(USERID) --build-arg USERNAME=cytools\
--build-arg USERID=$(USERID) --build-arg ARCH=$(arch) --build-arg AARCH=$(aarch)\
--build-arg VIRTUAL_ENV=/home/cytools/cytools-venv/ --build-arg ALLOW_ROOT_ARG=" "\
Expand All @@ -69,7 +69,7 @@ build-fast:
else \
notify-send "CYTools" "The CYTools image has started building. We'll notify you once it's done :)" || echo ""; \
fi
sudo docker pull debian:bullseye
sudo docker pull python:3.11-bullseye
sudo docker build -t cytools:uid-$(USERID) --build-arg USERNAME=cytools\
--build-arg USERID=$(USERID) --build-arg ARCH=$(arch) --build-arg AARCH=$(aarch)\
--build-arg VIRTUAL_ENV=/home/cytools/cytools-venv/ --build-arg ALLOW_ROOT_ARG=" "\
Expand Down Expand Up @@ -151,7 +151,7 @@ build-with-root-user:
@ echo "Deleting old CYTools image..."
sudo docker rmi cytools:root | echo "Old CYTools image does not exist or cannot be deleted"
@ echo "Building CYTools image for root user..."
sudo docker pull debian:bullseye
sudo docker pull python:3.11-bullseye
sudo docker build -t cytools:root --build-arg USERNAME=root\
--build-arg USERID=0 --build-arg ARCH=$(arch) --build-arg AARCH=$(aarch)\
--build-arg VIRTUAL_ENV=/opt/cytools/cytools-venv/ --build-arg ALLOW_ROOT_ARG="--allow-root"\
Expand Down
9 changes: 9 additions & 0 deletions cytools/polytopeface.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,15 @@ def triangulate(self, heights=None, points=None, simplices=None,
**Returns:**
*(Triangulation)* A [`Triangulation`](./triangulation) object describing
a triangulation of the polytope.
**Example:**
We construct a face from a polytope and triangulate it.
```python {3}
p = Polytope([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1],[-1,-1,-1,-1]])
f = p.faces(3)[0] # Pick one of the 3-faces
f.triangulate()
# A fine, regular triangulation of a 3-dimensional point configuration with 4 points in ZZ^4
```
"""
# check if we're just grabbing the Delaunay triangulation
if (simplices is None) and (heights is None):
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ MarkupSafe==2.1.2
matplotlib==3.7.1
matplotlib-inline==0.1.6
mistune==2.0.5
Mosek==10.0.40
Mosek==10.1.11
nbclassic==0.5.5
nbclient==0.7.3
nbconvert==7.3.1
Expand All @@ -78,7 +78,6 @@ pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.5.0
pip==23.0.1
pkg-resources==0.0.0
platformdirs==3.2.0
pplpy==0.8.7
prometheus-client==0.16.0
Expand All @@ -101,7 +100,7 @@ qpsolvers==3.4.0
requests==2.28.2
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
scikit-sparse==0.4.8
scikit-sparse==0.4.12
scipy==1.10.1
scs==3.2.3
Send2Trash==1.8.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/windows/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set PWS=powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile
docker info || echo. && echo "Please make sure that Docker is installed and running" && timeout /t 10 && exit

docker rmi cytools || echo "Old CYTools image does not exist or cannot be deleted"
docker pull debian:bullseye
docker pull python:3.11-bullseye
docker build --no-cache --force-rm -t cytools --build-arg USERNAME=root --build-arg USERID=0 --build-arg ARCH=amd64 --build-arg AARCH=x86_64 --build-arg VIRTUAL_ENV=/opt/cytools/cytools-venv/ --build-arg ALLOW_ROOT_ARG="--allow-root" --build-arg PORT_ARG=2875 ../../ || echo. && echo "There was an error while building the image. Please let the developers know, and try using a stable version of the package." && timeout /t 10 && exit

set TARGET="%appdata%\CYTools\cytools.bat"
Expand Down

0 comments on commit 46fe02a

Please sign in to comment.