Skip to content
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

Update README #228

Merged
merged 1 commit into from
Apr 15, 2024
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
18 changes: 4 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ ChemPy

.. image:: https://github.com/bjodah/chempy/actions/workflows/lint_python.yml/badge.svg
:target: https://github.com/bjodah/chempy/actions/workflows/lint_python.yml
:alt: Build status
:alt: Github Actions CI status
.. image:: https://hackspett.bjodah.se/api/badges/1/status.svg
:target: https://hackspett.bjodah.se/repos/1
:alt: Woodpecker CI status
.. image:: https://img.shields.io/pypi/v/chempy.svg
:target: https://pypi.python.org/pypi/chempy
:alt: PyPI version
.. image:: https://img.shields.io/badge/python-3.8,3.9-blue.svg
:target: https://www.python.org/
:alt: Python version
.. image:: https://img.shields.io/pypi/l/chempy.svg
:target: https://github.com/bjodah/chempy/blob/master/LICENSE
:alt: License
Expand Down Expand Up @@ -374,16 +374,6 @@ literature with relevance in chemistry. Here is how you use one of these formula
[H2O] = 55.18 M (at 35 °C)


Run notebooks using binder
~~~~~~~~~~~~~~~~~~~~~~~~~~
Using only a web-browser (and an internet connection) it is possible to explore the
notebooks here: (by the courtesy of the people behind mybinder)

.. image:: http://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/bjodah/chempy/f5f2546e79e165ba8fb258fc87d83a7fbdcbad64?filepath=index.ipynb
:alt: Binder


Citing
------
If you make use of ChemPy in e.g. academic work you may cite the following peer-reviewed publication:
Expand Down
55 changes: 0 additions & 55 deletions conda-recipe/meta.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions conda-recipe/run_test.sh

This file was deleted.

27 changes: 0 additions & 27 deletions environment.yml

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM docker.io/debian:bullseye

MAINTAINER Björn Dahlgren <bjodah@gmail.com>

Expand Down Expand Up @@ -29,6 +29,7 @@ RUN mkdir /tmp/sundials-5.5.0-build && \
cmake --build /tmp/sundials-5.5.0-build --target install && \
rm -r /tmp/sundials-5.5.0*/ && \
python3 -m pip install --upgrade-strategy=eager --upgrade pip && \
python3 -m pip install --upgrade-strategy=eager numpy cython setuptools && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


Expand Down
33 changes: 28 additions & 5 deletions scripts/host-jupyter-using-docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ue
#
# This script requires that Docker is installed.
# This script requires that Docker (or podman) is installed.
#
# Arguments: mount-path, port-number, Dockerfile-path
#
Expand All @@ -22,11 +22,27 @@ if [[ "${HOST_USER}" == root ]]; then
>&2 echo "Need another user name than root (pip will fail)"
exit 1
fi

if which podman; then
PODMAN=podman
elif which docker; then
if groups | grep docker; then
PODMAN=docker
else
PODMAN="sudo docker"
fi
else
>&2 echo "Neither podman nor docker found on \$PATH"
exit 1
fi

if [[ "$MOUNT" == .* ]]; then
MOUNT="$(pwd)/$MOUNT"
fi


if [[ "$DOCKERIMAGE" == ./* ]]; then
DOCKERIMAGE=$(sudo docker build $DOCKERIMAGE | tee /dev/tty | tail -1 | cut -d' ' -f3)
DOCKERIMAGE=$($PODMAN build $DOCKERIMAGE | tee /dev/tty | tail -1 | cut -d' ' -f3)
fi
if [[ "$PORT" == "0" ]]; then
LOCALCMD="pytest -sv -ra --pyargs $PKG"
Expand All @@ -40,7 +56,14 @@ useradd --uid \$HOST_UID --gid \$HOST_GID --home /mount \$HOST_WHOAMI; \
sudo --login -u \$HOST_WHOAMI PYCVODES_NO_LAPACK=1 PYCVODES_NO_KLU=1 python3 -m pip install --user -e .[all]; \
sudo --login -u \$HOST_WHOAMI /mount/.local/bin/jupyter-nbextension enable --user --py widgetsnbextension; \
sudo --login -u \$HOST_WHOAMI LD_LIBRARY_PATH=/usr/local/lib MPLBACKEND=Agg /mount/.local/bin/$LOCALCMD"

set -x
sudo docker run --rm --name "${PKG}_nb_${PORT}" $PORTFWD \
-e HOST_WHOAMI=${HOST_USER} -e HOST_UID=$(id -u ${HOST_USER}) -e HOST_GID=$(id -g ${HOST_USER})\
-v $MOUNT:/mount -w /mount -it $DOCKERIMAGE /bin/bash -x -c "$MYCMD"


$PODMAN run \
--rm \
--name "${PKG}_nb_${PORT}" $PORTFWD \
-e HOST_WHOAMI=${HOST_USER} \
-e HOST_UID=$(id -u ${HOST_USER}) \
-e HOST_GID=$(id -g ${HOST_USER}) \
-v $MOUNT:/mount -w /mount -it $DOCKERIMAGE /bin/bash -x -c "$MYCMD"
Loading