Skip to content

Commit 7bf9f05

Browse files
authored
Merge pull request #35 from fangohr/from-minimum
Review software provision, make CI pass again
2 parents 7e40ec1 + b0d3d8a commit 7bf9f05

File tree

13 files changed

+82
-3460
lines changed

13 files changed

+82
-3460
lines changed

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

3-
RUN apt-get update -y && apt-get install -y texlive-xetex latexmk texlive-xetex \
4-
texlive-fonts-extra fonts-freefont-otf python3 python3-pip git zile wget
3+
#RUN apt-get update -y && apt-get install -y texlive-xetex latexmk texlive-xetex \
4+
# texlive-fonts-extra fonts-freefont-otf python3 python3-pip git zile wget
55

6-
COPY poetry.lock pyproject.toml /opt/
6+
RUN apt-get update -y && apt-get install -y python3 python3-pip texlive-xetex \
7+
latexmk git zile wget texlive-fonts-extra python3-venv
78

8-
RUN pip install poetry==1.1.4
9+
COPY requirements.txt /opt/
910

1011
WORKDIR /opt/
11-
RUN poetry config virtualenvs.create false
12-
RUN poetry install -vvv
12+
RUN python3 -m venv venv
13+
RUN . venv/bin/activate && pip install -r requirements.txt
14+
RUN . venv/bin/activate && pip list
15+
# activate venv
16+
ENV PATH="/opt/venv/bin:$PATH"
1317

1418
RUN mkdir -p /io
1519
WORKDIR /io
1620

1721
# Need this for one nbval and chapter 1
1822
RUN ln -s /usr/bin/python3 /usr/local/bin/python
1923

24+
# supress warning when running jupyter-book in container
25+
ENV PYDEVD_DISABLE_FILE_VALIDATION=1
2026
CMD ["/bin/bash"]

Makefile

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all:
33
make pdf
44

55
install:
6-
poetry install -vvv
6+
pip install -r requirements.txt
77

88
clean:
99
cd book; rm -rf \
@@ -13,20 +13,20 @@ clean:
1313
_build .ipynb_checkpoints
1414

1515
html:
16-
poetry run jupyter-book build book --builder html
16+
jupyter-book build book --builder html
1717

1818
linkcheck:
19-
poetry run jupyter-book build book --builder linkcheck
19+
jupyter-book build book --builder linkcheck
2020

2121
pdf: book/*-*.ipynb
22-
poetry run jupyter-book build book --builder pdflatex
22+
jupyter-book build book --builder pdflatex
2323

2424
nbval:
2525
@echo "Testing all chapters (apart from 18) with --nbval"
26-
poetry run pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
26+
pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
2727
--ignore=book/18-environments.ipynb --ignore=book/_build
2828
@echo "Testing chapter 18 with --nbval-lax"
29-
poetry run pytest -v --nbval-lax book/18-environments.ipynb
29+
pytest -v --nbval-lax book/18-environments.ipynb
3030

3131

3232

@@ -44,16 +44,8 @@ docker-build:
4444
docker-build-nocache:
4545
docker build -t python4compscience2 --no-cache .
4646

47-
# Here we only bind the required directories and files into the docker container
48-
# at runtime to avoid potential conflicts with local files
49-
5047
define DOCKER_RUN
51-
docker run --workdir=/io \
52-
-v $(CURDIR)/book:/io/book \
53-
-v $(CURDIR)/Makefile:/io/Makefile \
54-
-v $(CURDIR)/poetry.lock:/io/poetry.lock \
55-
-v $(CURDIR)/pyproject.toml:/io/pyproject.toml \
56-
python4compscience
48+
docker run --rm -v $(CURDIR):/io python4compscience
5749
endef
5850

5951
docker-bash:

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ and schools. Please send a message to the author if you do so.
119119

120120
Hans Fangohr is a researcher and teacher (see
121121
[homepage](https://fangohr.github.io), [blog](https://fangohr.github.io/blog),
122-
[twitter](https://twitter.com/ProfCompMod)). His interests include effective
122+
[mastodon](https://fosstodon.org/@ProfCompMod)). His interests include effective
123123
software engineering for computational science and data science, researching
124124
computational modelling and data analysis methods, and education. He is a
125125
Professor at the [University of Southampton (UK)](https://www.southampton.ac.uk)

book/12-symbolic-computation.ipynb

Lines changed: 22 additions & 21 deletions
Large diffs are not rendered by default.

book/14-numpy.ipynb

Lines changed: 4 additions & 6 deletions
Large diffs are not rendered by default.

book/15-visualising-data.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"For more detailed information, check these links\n",
2929
"\n",
3030
"- A very nice introduction in the object oriented Matplotlib interface, and summary of all important ways of changing style, figure size, linewidth, etc. This is a useful reference:\n",
31-
" <https://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb>\n",
31+
" <https://github.com/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb>\n",
3232
"\n",
3333
"- [Matplotlib tutorial](https://matplotlib.org/stable/tutorials/index)\n",
3434
"\n",
@@ -46,7 +46,7 @@
4646
"\n",
4747
"This chapter focusses on the Pylab interface, but also provides examples for the object-oriented `matplotlib.pyplot` interface.\n",
4848
"\n",
49-
"An excellent introduction and overview of the `matplotlib.pyplot` plotting interface is available in <https://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb>."
49+
"An excellent introduction and overview of the `matplotlib.pyplot` plotting interface is available in <https://github.com/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb>."
5050
]
5151
},
5252
{
@@ -1135,7 +1135,7 @@
11351135
"\n",
11361136
"I would speculate that increasingly we will be using high-level plotting tools (such as pandas, xarray, holoviews) to explore data interactively.\n",
11371137
"\n",
1138-
"We can see a trend in data analysis libraries that data objects can be converted to such high-level annotated data objecs (such as European XFEL's [extra-data](https://extra-data.readthedocs.io) tools which can return a labelled xarray object). Other projects combine the metadata with the data in custom made objects to then provide convenience methods (such as [Ubermag](http://ubermag.github.io)'s [discretisedfield](https://ubermag.github.io/documentation/ipynb/discretisedfield/field-matplotlib-visualisation.html) object).\n",
1138+
"We can see a trend in data analysis libraries that data objects can be converted to such high-level annotated data objecs (such as European XFEL's [extra-data](https://extra-data.readthedocs.io) tools which can return a labelled xarray object). Other projects combine the metadata with the data in custom made objects to then provide convenience methods (such as [Ubermag](http://ubermag.github.io)'s [discretisedfield](discretisedfield/field-matplotlib-visualisation.html) object).\n",
11391139
"\n",
11401140
"Will we still need to learn the basics, such as the `matplotlib.pyplot` interface? Probably yes: the very least to fine tune the plots provided by these high level libraries: \n",
11411141
"\n"
@@ -1261,7 +1261,7 @@
12611261
"name": "python",
12621262
"nbconvert_exporter": "python",
12631263
"pygments_lexer": "ipython3",
1264-
"version": "3.10.1"
1264+
"version": "3.9.13"
12651265
}
12661266
},
12671267
"nbformat": 4,

book/16-scipy.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@
10431043
"import scipy.fft\n",
10441044
"import numpy as np\n",
10451045
"import matplotlib.pyplot as plt\n",
1046-
"pi = scipy.pi\n",
1046+
"pi = np.pi\n",
10471047
"\n",
10481048
"signal_length = 0.5 # [seconds]\n",
10491049
"sample_rate = 500 # sampling rate [Hz]\n",
@@ -1310,7 +1310,7 @@
13101310
"source": [
13111311
"Note that there are other functions to read from and write to in formats as used by IDL, Netcdf and other formats in `scipy.io`.\n",
13121312
"\n",
1313-
"More → see [Scipy tutorial](https://docs.scipy.org/doc/scipy/reference/tutorial/io.html)."
1313+
"More → see [Scipy tutorial](https://docs.scipy.org/doc/scipy/reference/io.html)."
13141314
]
13151315
}
13161316
],
@@ -1330,9 +1330,9 @@
13301330
"name": "python",
13311331
"nbconvert_exporter": "python",
13321332
"pygments_lexer": "ipython3",
1333-
"version": "3.9.7"
1333+
"version": "3.9.13"
13341334
}
13351335
},
13361336
"nbformat": 4,
13371337
"nbformat_minor": 1
1338-
}
1338+
}

book/_config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ html:
3737
crossorigin: "anonymous"
3838

3939

40+
launch_buttons:
41+
binderhub_url: "https://mybinder.org" # The URL for your BinderHub (e.g., https://mybinder.org)
42+
4043
# Allow parsing of "<img src=..." tags in markdown cells (used in Chapter 15 on visualisation)
4144
parse:
4245
myst_enable_extensions: # default extensions to enable in the myst parser. See https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html
@@ -60,4 +63,6 @@ sphinx:
6063
config:
6164
linkcheck_anchors: false
6265
linkcheck_workers: 10
63-
linkcheck_ignore : https://jacow.org/icalepcs2019/papers/tucpr02.pdf
66+
linkcheck_ignore : [https://jacow.org/icalepcs2019/papers/tucpr02.pdf,
67+
https://doi.org/10.1109/MCSE.2021.3059263,
68+
https://ieeexplore.ieee.org/document/9325550]

0 commit comments

Comments
 (0)