diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..993f4c1d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM jupyter/minimal-notebook:latest + +USER root + +RUN apt-get update && apt-get install -y libgl1-mesa-glx gdb + +RUN apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \ + libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \ + libharfbuzz-dev libfribidi-dev libxcb1-dev + +RUN apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase + +USER jovyan + +RUN python3 -m pip install gdbgui matplotlib coverage + +WORKDIR /home/jovyan + +COPY --chown=jovyan:users ./requirements.txt ./requirements.txt + +RUN pip install -r ./requirements.txt + +CMD start-notebook.sh diff --git a/README.md b/README.md index 2cf28137..67fce685 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,10 @@ Table of contents - [Usage](#usage) - [_Simple example to illustrate the use of SpatialPy_](#simple-example-to-illustrate-the-use-of-spatialpy) - [_Docker environment_](#docker-environment) - - [_Debugging_](#debugging) - - [_Profiling_](#profiling) - [Getting help](#getting-help) - [Contributing](#contributing) + - [_Debugging_](#debugging) + - [_Profiling_](#profiling) - [License](#license) - [Authors and history](#authors-and-history) - [Acknowledgments](#acknowledgments) @@ -72,8 +72,7 @@ SpatialPy provides simple object-oriented abstractions for defining a model of a The `run()` method can be customized using keyword arguments to select different solvers, random seed, data return type and more. For more detailed examples on how to use SpatialPy, please see the Jupyter notebooks contained in the [examples](https://github.com/StochSS/SpatialPy/tree/main/examples) subdirectory. - -### Docker environment +### Docker environment (DOES NOT WORK) You can use Docker to create a repeatable environment for developing and debugging SpatialPy. The supplied Dockerfile starts a jupyter server with SpatialPy dependencies installed. @@ -83,7 +82,7 @@ Otherwise: ```bash docker build -t spatialpy:latest . -docker run -v ./:/home/jovyan/spatialpy -v ./tmp:/tmp -p 8888:8888 -p 5000:5000 +docker run -it spatialpy:latest -v ./:/home/jovyan/spatialpy -v ./tmp:/tmp -p 8888:8888 -p 5000:5000 /bin/bash -c "start-notebook.sh" ``` The SpatialPy repo is mounted into /home/jovyan so you can import it in the usual way for development (see examples). @@ -92,16 +91,6 @@ Any changes you make to your local codebase are reflected in the docker containe The `/tmp` directory is also mounted for easy access to build and result directories. -### Debugging - -In order to compile the solver binary for use by the debugger, run `solver.compile()` with `debug=True`. This will inject the `-g` flag into the `gcc` command that compiles the solver, enabling gdb debug information. - -You can invoke `solver.run_debugger()` anytime after you instantiate a solver in Python to start up a new session of gdbgui. The debugger will be available at http://127.0.0.1:5000. - - -### Profiling - -To enable profiling, both `solver.compile()` and `solver.run()` need to be invoked with `profile=True`. If you don't run `solver.compile()` explicitly, invoking `solver.run()` with `profile=True` will run `compile()` correctly for you. Getting help ------------ @@ -121,6 +110,16 @@ New developments happen primarily in the [`develop`](https://github.com/StochSS/ |:---------------:|:--------------:| | [![Build Status](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml/badge.svg)](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml) | [![Build Status](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml/badge.svg?branch=develop)](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml) +### Debugging + +In order to compile the solver binary for use by the debugger, run `solver.compile()` with `debug=True`. This will inject the `-g` flag into the `gcc` command that compiles the solver, enabling gdb debug information. + +You can invoke `solver.run_debugger()` anytime after you instantiate a solver in Python to start up a new session of gdbgui. The debugger will be available at http://127.0.0.1:5000. + + +### Profiling + +To enable profiling, both `solver.compile()` and `solver.run()` need to be invoked with `profile=True`. If you don't run `solver.compile()` explicitly, invoking `solver.run()` with `profile=True` will run `compile()` correctly for you. License ------- diff --git a/RELEASE_NOTES b/RELEASE_NOTES deleted file mode 100644 index 718c22b1..00000000 --- a/RELEASE_NOTES +++ /dev/null @@ -1,17 +0,0 @@ - RELEASE NOTES - SpatialPy - -These are release notes for SpatialPy. ----------------------------------------- -Date: 2/25/2021 -Version: 0.5.0+beta ----------------------------------------- -- Initial beta release ----------------------------------------- -Date: 3/9/2021 -Version: 0.5.1+beta ----------------------------------------- -- Added pickling Results -- Added add_mesh() function -- timespan() now includes option to set timestep size -- Added ability to read StochSS domains