Mostly geared towards GNU make
I've used ->|
to indicate a tab character, as it's clearer to read than ⇥
- Set a target, its dependencies and the commands to execute in order
target: [dependencies]
->|
[ER; 2023-03-01] | |
When using the Conda channel "anaconda" and Python 3.7, the combination of the scipy package and the mpich package can cause problems. The mpich installation is a dependency of mpi4py, so the combination scipy / mpi4py has the same problem. (Note that I've tested and found the issue is the same with Python 3.10, and probably 3.8 and 3.9 as well, since mpich does not depend on Python. 3.11 is still to new (half a year old!) for the scipy package to be properly installed.) | |
SciPy has a dependency on libgfortran and ligfortran-ng: which one will be used, depends on the SciPy package selected, at least for libgfortran. This is the core of the problem. | |
When installing SciPy before MPIch, Conda will pick the most recent version. On Linux, this is scipy-1.7.3-py37h6c91a56_2 [*] (try in a new environment). | |
The related package file on anaconda.org is linux-64/scipy-1.7.3-py37h6c91a56_2.tar.bz2 . This shows, among others, the following dependencies: | |
libgfortran-ng, libgfortran5 >=11.2.0 |
Configuration files are a practical, and probably essential, thing to have your code run flexibly. A good configuration can prevent lots of tiny (or large!) errors, and make it easier for other people to use your code (or you yourself if you haven't used the code for a while).
Generally, there will be configuration files, to change things like
Prerequisities:
sudo
to install Python or a Python packages. There is no need for it, and it can only mess up your system. sudo
is only to be used to update the system, or install helper packages (libraries, compilers) to build Python or any package (such as NUmPy) from source, through the system package manager (such as apt
, dnf
or pacman
).That also means there is no need to install (system) packages such as python(3)-numpy
or python(3)-scipy
, or even python(3)-pip
. In fact, these could possibly even be uninstalled, and no harm would come from it. But if they are installed, let them be. They should not interfere with user-installed versions later on.
"""Example to cancel a set of asyncio coroutines (futures), | |
using one coroutine to signal the event loop to stop. | |
""" | |
import asyncio | |
import logging | |
from datetime import datetime | |
from concurrent.futures import CancelledError | |
/// Rust Fibonacci one-liner using `fold` | |
/// | |
/// Not very practical: only for one time use, | |
/// since it will have to re-calculate all terms again and again | |
/// if used in a loop to create multiple items. | |
/// The use of `_` also suggests this is not an ideal solution. | |
fn main() { | |
let n = 10; | |
let x = (0..n).fold((0, 1), |x, _| (x.0+x.1, x.0)).0; | |
println!("{}: {}", n, x); |
# Notes about values in the TOML config file: | |
# - strings should always be quoted. Multi-line strings are possible | |
# using triple-quotes, but should not be necessary in this config file | |
# - floating point values require a decimal dot, or an exponent (or | |
# both). Otherwise, they are interpreted as integers. | |
# More information about the TOML config format: https://github.com/toml-lang/toml | |
# Scenarios to use. | |
# This defines only the names and epoch. |
julia> VERSION | |
v"1.3.0" | |
julia> # Julia documention on array) comprehensions and generator expressions: | |
julia> # https://docs.julialang.org/en/v1/manual/arrays/#Comprehensions-1 | |
julia> # https://docs.julialang.org/en/v1/manual/arrays/#Generator-Expressions-1 | |
julia> # The code below uses generator expressions | |
julia> # Double list comprehension for the first fifty-one terms of the power series of the exponential function | |
julia> sum(prod(1/i for i in 1:n) for n in 1:50) + 1 |
name: base | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- iris=2.2.0=py36_1003 | |
- iris-sample-data=2.1.0=py_0 | |
- cftime=1.0.3.4=py36hd352d35_1001 | |
- numpy=1.16.2=py36_blas_openblash1522bff_0 | |
- pandas=0.23.4=py36h637b7d7_1000 |
2018-10-16 08:43:28,966 UTC [50059] INFO esmvaltool._main:123 | |
______________________________________________________________________ | |
_____ ____ __ ____ __ _ _____ _ | |
| ____/ ___|| \/ \ \ / /_ _| |_ _|__ ___ | | | |
| _| \___ \| |\/| |\ \ / / _` | | | |/ _ \ / _ \| | | |
| |___ ___) | | | | \ V / (_| | | | | (_) | (_) | | | |
|_____|____/|_| |_| \_/ \__,_|_| |_|\___/ \___/|_| | |
______________________________________________________________________ | |
ESMValTool - Earth System Model Evaluation Tool |