ISciNumPy.dev
https://iscinumpy.dev/
Recent content on ISciNumPy.devHugoen-us[email protected] (Henry Schreiner)[email protected] (Henry Schreiner)Fri, 06 Feb 2026 17:16:40 -0500New in boost-histogram 1.7 / Hist 2.10
https://iscinumpy.dev/post/hist-2-10/
Fri, 06 Feb 2026 17:16:40 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/hist-2-10/<figure class="dark"><img src="https://iscinumpy.dev/post/boost-histogram-06/images/BoostHistogramPythonLogo.png"
alt="boost-histogram logo" width="405">
</figure>
<p>I’ve just released <a href="https://github.com/scikit-hep/boost-histogram/releases/tag/v1.7.0">boost-histogram 1.7</a> and <a href="https://github.com/scikit-hep/hist/releases/tag/v2.10.0">hist 2.10</a>, with a major new
feature and a big typing improvement! I’d like to quickly outline what’s new
here. Python 3.10+ is now required.</p>Tools to help you write better code
https://iscinumpy.dev/page/presentations/2026-01-16-sqat/
Fri, 16 Jan 2026 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2026-01-16-sqat/How we made Python's packaging library 3x faster
https://iscinumpy.dev/post/packaging-faster/
Fri, 09 Jan 2026 13:30:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/packaging-faster/<p>Along with a <a href="https://github.com/pypa/pip">pip</a> (and now <a href="https://github.com/pypa/packaging">packaging</a>) maintainer, Damian Shaw, I have
been working on making <a href="https://github.com/pypa/packaging">packaging</a>, the library behind almost all packaging
related tools, faster at reading versions and specifiers, something tools like
pip have to do thousands of times during resolution. Using Python 3.15’s new
statistical profiler and metadata from every package ever uploaded to PyPI, I
measured and improved core Packaging constructs while keeping the code readable
and simple. Reading in <code>Version</code>s can be up to 2x faster and <code>SpecifierSet</code>s can
be up to 3x faster in <a href="https://github.com/pypa/packaging/releases/tag/26.0">packaging <code>26.0</code></a>, now released! Other
operations have been optimized, as well, up to 5x in some cases. See the
<a href="https://discuss.python.org/t/announcement-packaging-26-0rc1-released/105631">announcement</a> and <a href="https://packaging.pypa.io/en/stable/changelog.html">release notes</a> too; this post will focus on the
performance work only.</p>Advent of Code 2025 in Typescript
https://iscinumpy.dev/post/aoc-2025/
Wed, 24 Dec 2025 00:09:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/aoc-2025/<p>After two years of <a href="https://adventofcode.com">Advent of Code</a> in <a href="https://rust-lang.org">Rust</a>, I thought I’d try
<a href="https://www.typescriptlang.org">TypeScript</a>. I’ve always wanted to improve <a href="https://repo-review.readthedocs.io/en/latest">repo-review</a>’s
<a href="https://learn.scientific-python.org/development/guides/repo-review">webapp</a>, and that requires knowledge of the packaging
systems for JavaScript, so I thought I’d try TypeScript this year. I also used
this as an opportunity to learn more AI tooling too, mostly CoPilot in
<a href="https://code.visualstudio.com">VSCode</a> & <a href="https://chatgpt.com">ChatGPT</a>. I’d like to share my experience and thoughts! My code
is at <a href="https://github.com/henryiii/aoc2025">aoc2025</a> (and <a href="https://github.com/henryiii/aoc2024">aoc2024</a>, <a href="https://github.com/henryiii/aoc2023">aoc2023</a>).</p>What's new in Python π
https://iscinumpy.dev/page/presentations/2025-11-24-rse/
Mon, 24 Nov 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-11-24-rse/Python Histograms
https://iscinumpy.dev/page/presentations/2025-11-12-rse/
Wed, 12 Nov 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-11-12-rse/Using Venvs
https://iscinumpy.dev/page/presentations/2025-09-19-hsf-india/
Fri, 19 Sep 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-09-19-hsf-india/UHI 1.0: histogram serialization
https://iscinumpy.dev/post/uhi-1-0/
Wed, 20 Aug 2025 16:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/uhi-1-0/<p><a href="https://github.com/scikit-hep/uhi/releases/tag/v1.0.0">UHI 1.0</a> is out, with a major new feature: a new histogram serialization
spec! This spec supports multiple formats (HDF5, zip, and JSON initially), and
can be supported by multiple libraries (Boost-histogram/hist initially). There’s
also a new test suite helper for libraries targeting the UHI indexing spec.</p>pybind11 3.0.0
https://iscinumpy.dev/post/pybind11-3-0-0/
Thu, 10 Jul 2025 00:13:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/pybind11-3-0-0/<figure class="dark"><img src="https://iscinumpy.dev/post/pybind11-2-6-0/images/pybind11-logo.png"
alt="pybind11 logo" width="405">
</figure>
<p>Pybind11 3.0 has been released! I would like to highlight some of the key
changes below; be sure to check out the <a href="https://pybind11.readthedocs.io/en/latest/changelog.html">changelog</a> and <a href="https://pybind11.readthedocs.io/en/latest/upgrade.html">upgrade guide</a> for
more information! This release includes an ABI bump, the first required bump in
many years on Unix (Windows has had required bumps more often). This release
contains the multi-year smart-holder branch, multi-phase init and subinterpreter
support, <code>py::native_enum</code>, an interface to warnings, typing improvements, and
more. CMake now defaults to <a href="https://cmake.org/cmake/help/latest/module/FindPython.html">FindPython</a> mode.</p>
<p>Support for Python 3.14, 3.14t, GraalPy, PyPy 3.11, and iOS have been added,
while legacy support for Python 3.7, PyPy 3.8/3.9, and CMake <3.15 has been
removed. Most deprecated features have been kept for this release, but anything
producing a warning in 3.0 may be removed in a future 3.x version.</p>Packaging a Scientific Python Project
https://iscinumpy.dev/page/presentations/2025-0709-scipy/
Wed, 09 Jul 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-0709-scipy/🎡 cibuildwheel 3.0
https://iscinumpy.dev/post/cibuildwheel-3-0-0/
Thu, 05 Jun 2025 01:54:45 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-3-0-0/<p><a href="https://cibuildwheel.pypa.io">cibuildwheel</a> 3.0.0 is out, with some very big additions. We’ve added
GraalPy, Python 3.14 (and 3.14t) betas, and iOS support! We’ve got several new
options: <code>test-sources</code>, <code>test-environment</code>, and (experimental)
<code>pyodide-version</code>. We now fully use <code>enable</code> (and PyPy requires using it), and
we no longer inject setuptools and wheel in build environments. Defaults have
changed, too: <code>build</code> is now the default frontend, <code>manylinux_2_28</code> is the
default manylinux image, with 32-bit linux now being opt-in. We’ve removed
support for Python 3.6 and 3.7, we now require 3.11+ to run cibuildwheel itself,
and EoL manylinux/musllinux images now need to be fully specified.</p>
<p>We’ve had some fantastic releases of cibuildwheel since my last post over 2.19,
so I’ll include a few of the new features from those releases, too. I’ll also
note a few of the features being worked on for future releases.</p>Python π
https://iscinumpy.dev/post/python-314/
Thu, 08 May 2025 09:05:54 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-314/<p>Python π (3.14) is out! The big feature this time around is template strings.
Free-threading is no longer experimental. There’s also lots more color
(including syntax highlighting in the REPL!), remote debugging, deferred
evaluation of annotations, and the usual error message and performance
improvements. Subintepreters are now accessible without the C-API (finally!),
and free-threaded Python is no longer experimental.</p>Building Python Packages
https://iscinumpy.dev/page/presentations/2025-03-19-rse/
Wed, 19 Mar 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-03-19-rse/Tools to help you write better code
https://iscinumpy.dev/page/presentations/2025-01-22-sqat/
Wed, 22 Jan 2025 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2025-01-22-sqat/scikit-build-core 0.10
https://iscinumpy.dev/post/scikit-build-core-0-10/
Mon, 05 Aug 2024 23:09:13 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/scikit-build-core-0-10/<p>Scikit-build-core 0.10 is out, and it is one of the largest releases we’ve
produced in terms of new configuration options. It automatically reads your
minimum CMake version, you can tell it to read your scikit-build-core
minimum-version, and there are settings for many of the advanced things users
used to do with scikit-build (classic), like rebuilds or pure Python fallbacks
on build failures.</p>The two flavors of Python 3.13
https://iscinumpy.dev/page/presentations/2024-07-01-pyhep/
Mon, 01 Jul 2024 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2024-07-01-pyhep/🎡 cibuildwheel 2.19
https://iscinumpy.dev/post/cibuildwheel-2-19-0/
Mon, 10 Jun 2024 12:05:51 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-2-19-0/<p><a href="https://cibuildwheel.pypa.io">cibuildwheel</a> 2.19 is out, with some very big additions. A new platform,
<a href="https://pyodide.org">Pyodide</a>, has been added for building WebAssembly wheels. We’ve added CPython
3.13 free-threaded builds, now on all OS’s. And we have an opt-in speed
improvement with the <code>build[uv]</code> build-frontend option.</p>
<p>We’ve had some fantastic releases of cibuildwheel since my last post over 2.10,
so I’ll include a few of the new features from those releases, too, with a
highlight on a larger feature that can use more explaining: <code>inherit</code> for
overrides.</p>Modern binary build systems
https://iscinumpy.dev/page/presentations/2024-05-17-pycon/
Fri, 17 May 2024 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2024-05-17-pycon/Python 3.13
https://iscinumpy.dev/post/python-313/
Thu, 09 May 2024 15:33:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-313/<p>Python 3.13 betas are out (Edit: 3.13.0 is out!), which means the features are
locked in. For the first time in thirty years, Python has a new, more colorful
REPL! There’s also a no-GIL compile-time option (free-threaded), an optional
JIT, some new typing features, and better error messages (again).</p>Software Quality Assurance Tooling
https://iscinumpy.dev/page/presentations/2024-01-23-sqat/
Tue, 23 Jan 2024 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2024-01-23-sqat/Learning Rust with Advent of Code 2023
https://iscinumpy.dev/page/presentations/2024-01-10-rust/
Wed, 10 Jan 2024 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2024-01-10-rust/Inline run dependencies in pipx 1.4.2
https://iscinumpy.dev/post/pep723/
Mon, 04 Dec 2023 15:00:06 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/pep723/<p>While it can also do much more, Python is a fantastic language for writing small
scripts and utilities with it’s expressive syntax and batteries-included
standard library. But what if you need just a bit more? PyPI is one of the best
package repositories for any language, and being able to access it <em>without</em>
having to write a multi-file library and setting up virtual environments would
be a dream - one that is becoming reality. Pipx 1.4.2 has an experimental
implementation of the <del>provisionally</del> accepted <a href="https://peps.python.org/pep-0723">PEP 723</a>, and I’d like to
show it off here, as it’s tremendously useful for simple scripts & utilities.
Support is also available in Nox 2024.04.15 and Hatch 1.10.</p>Project report - henryiii
https://iscinumpy.dev/page/presentations/2023-11-13-rsepeer/
Mon, 13 Nov 2023 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2023-11-13-rsepeer/Software Quality Assurance Tooling
https://iscinumpy.dev/page/presentations/2023-10-27-sqat/
Fri, 27 Oct 2023 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2023-10-27-sqat/C++23
https://iscinumpy.dev/post/cpp-23/
Mon, 23 Oct 2023 11:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cpp-23/<p>C++23 is complete and pretty much finalized, so let’s explore the new features
in C++, from a data science point of view. This is not as large of a release as
C++20 or C++11, but it’s still a hefty release with lots of nice new features -
larger than C++17.</p>
<p>Some of the major new features are building on themes from C++20, such as vastly
expanded ranges and views, more <code>constexpr</code>/<code>consteval</code>, module support for the
standard library, <code>std::print</code> to supplement <code>std::format</code>, and a
<code>std::generator</code> to support coroutines. There are also several general features,
lambdas and classes get along much better now, there are new preprocessor
additions (!), a stacktrace library, flat maps/sets, and new <code>std::optional</code>
monadics, deducing <code>this</code>, and many various additions.</p>The Scientific Python Development Guide
https://iscinumpy.dev/post/cookie/
Fri, 14 Jul 2023 00:45:32 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cookie/<p>One outcome of the
<a href="https://scientific-python.org/summits/developer/2023/">2023 Scientific Python Developer Summit</a>
was the <a href="https://learn.scientific-python.org/development">Scientific Python Development Guide</a>, a comprehensive guide to modern
Python package development, complete with a <a href="https://github.com/scientific-python/cookie">new project template</a>
supporting 12 build backends and a <a href="https://learn.scientific-python.org/development/guides/repo-review">WebAssembly-powered checker</a>
with checks linked to the guide. The guide covers topics like <a href="https://learn.scientific-python.org/development/guides/packaging-simple/">modern</a>,
<a href="https://learn.scientific-python.org/development/guides/packaging-compiled/">compiled</a>, and <a href="https://learn.scientific-python.org/development/guides/packaging-classic/">classic</a> packaging, <a href="https://learn.scientific-python.org/development/guides/style/">style</a> checks, <a href="https://learn.scientific-python.org/development/guides/mypy/">type
checking</a>, <a href="https://learn.scientific-python.org/development/guides/docs/">docs</a>, <a href="https://learn.scientific-python.org/development/guides/tasks/">task runners</a>, <a href="https://learn.scientific-python.org/development/guides/gha-basic/">CI</a>, <a href="https://learn.scientific-python.org/development/guides/pytest/">tests</a>,
and much more! There also are sections of <a href="https://learn.scientific-python.org/development/tutorials/">tutorials</a>, <a href="https://learn.scientific-python.org/development/principles/">principles</a>, and
some common <a href="https://learn.scientific-python.org/development/patterns/">patterns</a>.</p>
<p>This guide (along with cookie & repo-review) started in <a href="https://scikit-hep.org">Scikit-HEP</a> in 2020.
During the summit, it was merged with the <a href="https://nsls-ii.github.io/">NSLS-II</a> guidelines, which provided
the basis for the <a href="https://learn.scientific-python.org/development/principles/">principles</a> section. I’d like to thank and acknowledge Dan
Allan and Gregory Lee for working tirelessly during the summit to rework,
rewrite, merge, and fix the guide, including writing most of the <a href="https://learn.scientific-python.org/development/tutorials/">tutorials</a>
pages and first <a href="https://learn.scientific-python.org/development/patterns/">patterns</a> page, and rewriting the <a href="https://learn.scientific-python.org/development/tutorials/dev-environment/">environment</a> page as a
tutorial.</p>Introducing repo-review
https://iscinumpy.dev/post/repo-review/
Thu, 13 Jul 2023 22:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/repo-review/<p>I’ve released a new<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> toolkit for running checks, similar to Ruff and Flake8
but designed to check configuration, called <a href="https://repo-review.readthedocs.io">repo-review</a>. It requires Python
3.10+<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> to run and has no built-in checks, but is easy to write plugins for. A
set of checks based on the <a href="https://learn.scientific-python.org/development">Scientific Python Development Guide</a> (which I also
<a href="https://iscinumpy.dev/post/cookie">have a post about</a>!) are available as a plugin, <code>sp-repo-review</code>.
You can run <code>repo-review</code> in WebAssembly (via Pyodide), or in pre-commit, or as
a GitHub Action. It supports multiple output formats, including Rich, HTML, and
JSON. The system is based on fixtures (like pytest) and topologically sorts
requirements. You don’t need to depend on repo-review to add a repo-review
plugin. You can see a live version using sp-repo-review
<a href="https://learn.scientific-python.org/development/guides/repo-review/">in-place here</a>
or <a href="https://scientific-python.github.io/repo-review/">standalone here</a>.</p>Python 3.12
https://iscinumpy.dev/post/python-312/
Mon, 19 Jun 2023 17:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-312/<p>Python 3.12’s beta’s are out, which means the features are locked in. The theme
this year has been cleanup and typing. <code>distutils</code> has been removed, and
setuptools is no longer present in default environments.</p>Software Quality Assurance Tooling
https://iscinumpy.dev/page/presentations/2023-01-23-sqat/
Mon, 23 Jan 2023 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2023-01-23-sqat/Setup Windows
https://iscinumpy.dev/post/setup-windows/
Mon, 12 Dec 2022 11:54:16 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/setup-windows/<p>I set up an ARM DevKit recently, so I wanted to catalog what I do to setup
Windows here. This is not as polished or complete as my macOS setups, because
this is not something I use as a daily driver. But it might be useful, and I’m
open to suggestions to improve it. This should work for Intel or ARM Windows.</p>
<p>Also see <a href="https://iscinumpy.dev/post/setup-a-new-mac">macOS</a> <a href="https://iscinumpy.dev/post/setup-apple-silicon">(AS)</a>.</p>What's new in Python 3.11
https://iscinumpy.dev/page/presentations/2022-10-19-rse/
Wed, 19 Oct 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-10-19-rse/🎡 cibuildwheel 2.10
https://iscinumpy.dev/post/cibuildwheel-2-10-0/
Tue, 13 Sep 2022 08:42:26 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-2-10-0/<p><a href="https://github.com/pypa/cibuildwheel">cibuildwheel</a> 2.10 is out, with some important additions. PEP 517 config
settings added, <code>--only</code> (which has an interesting use in GHA), and Cirrus CI
support (including our first Apple Silicon native runner!) are highlights. We
also support Python 3.11 now (as of 2.11.2, RC’s in older releases).</p>
<p>We’ve had some fantastic releases of cibuildwheel this year, including some very
powerful features you might be interested in using, and I haven’t covered
releases since 2.2, so let’s take an in-depth look at what’s new for this and
the last few releases!</p>Everything you didn't know you needed
https://iscinumpy.dev/page/presentations/2022-08-05-codas-hep/
Fri, 05 Aug 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-08-05-codas-hep/Python 3.10
https://iscinumpy.dev/post/python-310/
Sat, 23 Jul 2022 10:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-310/<p>Python 3.10 is out (and has been for a while, I’m late posting this), with new
features and changes. The big new language feature this update is pattern
matching. We get much better errors, the always-present typing improvements, and
finally some real usage of the new PEG parser from 3.9.</p>Building binary extensions with pybind11, scikit build, and cibuildwheel
https://iscinumpy.dev/page/presentations/2022-07-15-scipy/
Fri, 15 Jul 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-07-15-scipy/Awkward Packaging: building Scikit-HEP
https://iscinumpy.dev/page/presentations/2022-07-14-scipy/
Thu, 14 Jul 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-07-14-scipy/Python 3.11
https://iscinumpy.dev/post/python-311/
Wed, 11 May 2022 16:11:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-311/<p>Python 3.11 has hit the beta (now released!) stage, which means no more new
features. It’s a perfect time to play with it! The themes in this update are the
standard ones: The faster CPython project is now fully going (3.11 is 25% faster
on average), along with improved error messages, typing, and asyncio. Beyond
this, the only major new feature is a library for reading TOML files; this
probably only exciting if you are involved in Python packaging (but I am, so I’m
excited!).</p>Scikit-HEP Developer Pages: Guidelines for modern packaging
https://iscinumpy.dev/page/presentations/2022-04-30-pycon/
Sat, 30 Apr 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-04-30-pycon/Building Binary Packages
https://iscinumpy.dev/page/presentations/2022-04-29-pycon/
Fri, 29 Apr 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-04-29-pycon/Digital RSE: Automatic Code Quality Checks
https://iscinumpy.dev/page/presentations/2022-03-09-rse/
Tue, 08 Mar 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-03-09-rse/boost-histogram / Hist
https://iscinumpy.dev/page/presentations/2022-03-02-pyhep/
Wed, 02 Mar 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-03-02-pyhep/CMake best practices
https://iscinumpy.dev/page/presentations/2022-02-02-sc/
Wed, 02 Feb 2022 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2022-02-02-sc/Python 3.7
https://iscinumpy.dev/post/python-37/
Sat, 15 Jan 2022 22:41:05 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-37/<p>Python 3.7 has been out for a while. In fact, it’s the oldest version of Python
still receiving support when this was written. I’d still like to write a “what’s
new”, targeting users who are upgrading to a Python 3.7+ only codebase, and want
to know what to take advantage of!</p>Poetry Versions
https://iscinumpy.dev/post/poetry-versions/
Thu, 09 Dec 2021 11:00:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/poetry-versions/<p><a href="https://python-poetry.org">Poetry</a> provides a all in one solution to Python packaging. I want to focus
on why I was quite hard on Poetry in my last post, specifically on its default
version capping and solver quirks, and also a few other negative things. This is
a followup to
<a href="https://iscinumpy.dev/post/bound-version-constraints">Should you have upper version bounds</a>, which
you should read before this post.</p>Should You Use Upper Bound Version Constraints?
https://iscinumpy.dev/post/bound-version-constraints/
Thu, 09 Dec 2021 10:00:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/bound-version-constraints/<p>Bound version constraints (upper caps) are starting to show up in the Python
ecosystem. This is causing <a href="https://github.com/scikit-hep/pyhf/discussions/1595">real world problems</a> with
libraries following this recommendation, and is likely to <a href="https://github.com/pypa/packaging/pull/482#issuecomment-963030131">continue to get
worse</a>; this practice does not scale to large numbers
of libraries or large numbers of users. In this discussion I would like to
explain why <em>always</em> providing an upper limit causes far more harm than good
<em>even for true SemVer libraries</em>, why libraries that pin upper limits require
<em>more frequent</em> updates rather than less, and why it is not scalable. After
reading this, hopefully you will always consider every cap you add, you will
know the (few) places where pinning an upper limit is reasonable, and will
possibly even avoid using libraries that pin upper limits needlessly until the
author updates them to remove these pins.</p>
<p>If this 10,000 word behemoth is a bit long for you, then skip around using the
table of contents, or see the <a href="#tldr">TL;DR</a> section at the end, or read
<a href="https://bernat.tech/posts/version-numbers">version numbers by Bernát Gábor</a>, which is shorter but is a
fantastic read with good examples and cute dog pictures. Or
<a href="https://hynek.me/articles/semver-will-not-save-you/">Hynek’s Semantic Versioning Will Not Save You</a>
Be sure to check at least
<a href="#analysis-of-a-javascript-project">the JavaScript project analysis</a> before you
leave!</p>
<p>Also be warned, I pick on <a href="https://python-poetry.org">Poetry</a> quite a bit. The rising popularity of
<a href="https://python-poetry.org">Poetry</a> is likely due to the simplicity of having one tool vs. many for
packaging, but it happens to also have a special dependency solver, a new upper
bound syntax, and a <a href="https://python-poetry.org/docs/faq/#why-are-unbound-version-constraints-a-bad-idea">strong recommendation to always limit upper
versions</a> - in direct opposition to <a href="https://snarky.ca/why-i-dont-like-semver/">members of the
Python core developer team</a> and PyPA developers. Not
all libraries with excessive version capping are Poetry projects (like
TensorFlow), but many, many of them are. To be clear, Poetry doesn’t force
version pinning on you, but it does push you really, really hard to always
version cap, and it’s targeting new Python users that don’t know any better yet
than to accept bad recommendations. And these affect the whole ecosystem,
including users who do not use poetry, but want to depend on libraries that do!
I do really like other aspects of Poetry, and would like to
<a href="https://iscinumpy.dev/post/scikit-build-proposal">eventually</a> help it build binary packages with Scikit-build
(CMake) via a plugin, and it has some great developers. If I don’t pick on
Poetry enough for you, don’t worry, I have a
<a href="https://iscinumpy.dev/post/poetry-versions">follow-up post</a> that picks on it in much more detail.
Also, check out <a href="https://pdm.fming.dev">pdm</a>, which gives many of the benefits of Poetry while
following PEP standards. Also <a href="https://pixi.sh">pixi</a>, which works with the Conda ecosystem.</p>
<p>If you come across something that can’t be solved, try using
<code>--exclude-newer <DATE></code> in <a href="https://github.com/astral-sh/uv">uv</a> and <a href="https://pdm.fming.dev">pdm</a>. This limits the solve by
ignoring packages newer than some date.</p>App vs Library
https://iscinumpy.dev/post/app-vs-library/
Thu, 09 Dec 2021 09:00:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/app-vs-library/<p>What is the difference between an app and a library? This seemingly simple
question confuses some, and it turns out to be a harder question to answer than
you might expect. While the actual distinction between these common terms will
always be muddled in practice, I propose a specific definition to be used when
considering dependencies. This distinction is important when
<a href="https://iscinumpy.dev/posts/bound-version-constraints">discussing bound version constraints</a> in the
next post.</p>Scikit Build Proposal
https://iscinumpy.dev/post/scikit-build-proposal/
Wed, 27 Oct 2021 08:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/scikit-build-proposal/<p>I’ve spent the last few years trying to make it easy for anyone to extend Python
with compiled languages. I’ve worked on <a href="https://github.com/pybind/pybind11">pybind11</a>, a powerful C++ library
that allows users to write advanced Python extensions using just C++11, used by
some of the largest projects, SciPy, PyTorch, Google, LLVM, and tens of
thousands of other libraries, down to very small extensions. I also work on
<a href="https://github.com/pypa/cibuildwheel">cibuildwheel</a>, which makes building binaries (called wheels) on continuous
integration (CI) simple. It is again powerful enough to used by huge projects,
like Scikit-learn, matplotlib, mypy; and is simple enough to be used by hundreds
of other packages. Recently it was accepted into the Python Packaging Authority
(PyPA). There is one missing piece, though, to complete this picture of compiled
extensions that easy to use for small projects, and powerful enough for large
projects: the build system. I believe the solution to that is <a href="https://github.com/scikit-build/scikit-build">scikit-build</a>,
and I’d like to work on it over the next three years.</p>
<p>Scikit-build is a tool for integrating a package with a CMake build system into
Python. You can utilize the vast collection of packages and projects using CMake
already, and you have access to modern building features, like multithreaded
builds, library discovery, superb compiler and IDE support, and all sorts of
extended tooling. Modern CMake is quite pleasant to write compared to times
past; I have written <a href="https://cliutils.gitlab.io/modern-cmake/">a book</a> and <a href="https://hsf-training.github.io/hsf-training-cmake-webpage">training course</a> on it. We
ship up-to-date <code>cmake</code> and <code>ninja</code> wheels for all binary platforms.</p>
<p>Update: Funded! I’ll be working on this starting August 1, 2022!</p>
<p>I wrote a proposal for an NSF CSSI Elements project containing three parts. The
first part will cover core development on Scikit-build to address the current
shortcomings and to prepare it for a post-distutils (Python 3.12+) world. The
second part would cover assisting libraries with a science use case in either
transitioning to scikit-build (ideally from an existing CMake build system with
Python bindings, but I can help mentor developers in writing bindings (ideally
pybind11), setting up CI, and writing CMake code as well (see my book or
workshop on Modern CMake, and I’m happy to help old scikit-build projects
transition to better practices). As part of this, I would be building up the
examples and documentation, leading into the third part of the proposal: A
series of training events and training material, including plans for something
alongside SciPy.</p>
<p>You can also see an outline at
<a href="https://github.com/scikit-build/scikit-build/wiki">scikit-build/scikit-build/wiki</a>
or at the end of this post.</p>
<p>Thank you for all the projects! The proposal was submitted Dec 8, 2021; mid year
we should find out if it was accepted!</p>Useful Links
https://iscinumpy.dev/page/useful-links/
Fri, 22 Oct 2021 15:44:45 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/page/useful-links/<h1 id="python">Python</h1>
<h2 id="learning-materials">Learning materials</h2>
<ul>
<li><a href="https://hepsoftwarefoundation.org/training/curriculum.html">HSF training curriculum (Python, bash, git, docker, and more)</a></li>
</ul>
<h2 id="topical-articles">Topical articles</h2>
<h3 id="cpython-core-developers">CPython core developers</h3>
<p><strong>Brett Cannon</strong> is a CPython core developer, and is very interested in
standardizing packaging. <a href="https://snarky.ca">https://snarky.ca</a></p>
<ul>
<li><a href="https://snarky.ca/why-i-dont-like-semver/">Why I don’t like SemVer anymore</a>:
A great resource to make you think about what SemVer means and where it falls
short.</li>
<li><a href="https://snarky.ca/what-the-heck-is-pyproject-toml/">What the heck is pyproject.toml</a>:
A intro to modern Python packaging</li>
<li><a href="https://snarky.ca/a-quick-and-dirty-guide-on-how-to-install-packages-for-python/">A quick-and-dirty guide on how to install packages for Python</a>:
This showw the “correct” way to throw together packages (pre-pipx).</li>
</ul>
<p><strong>Paul Ganssle</strong> is CPython core developer, and maintains zoneinfo.
<a href="https://blog.ganssle.io">https://blog.ganssle.io</a></p>🎡 cibuildwheel 2.2
https://iscinumpy.dev/post/cibuildwheel-2-2-0/
Wed, 20 Oct 2021 11:27:29 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-2-2-0/<p>Another great release from <a href="https://cibuildwheel.readthedocs.io">cibuildwheel</a>, <a href="https://github.com/pypa/cibuildwheel/releases/tag/v2.2.0">2.2.0</a>, is out! There are a few
important additions in this release that you should be aware of, so I will
outline the major changes here. We will cover the new musllinux wheels, overload
configuration, and incoming changes to pip and PyPy expected in the next
release. As always, it is recommended that you pin your cibuildwheel version and
then provide some automated way to keep the pin up-to-date, such as GitHub’s
dependabot. You should be updating just before you make a release, as well, but
you probably don’t want to be surprised by new wheels during your release
process!</p>🎡 cibuildwheel 2.0
https://iscinumpy.dev/post/cibuildwheel-2-0/
Fri, 16 Jul 2021 12:23:20 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-2-0/<p>The <a href="https://cibuildwheel.readthedocs.io">cibuildwheel</a> package has just had a major release with some fantastic
features. Python 2.7 and 3.5 support has been removed (and PyPy3.6), allowing us
to update to the latest manylinux and auditwheel versions, and support the newly
unified manylinux PyPy3.7 images. We now allow users to select <code>pypa/build</code> as a
build frontend. We now have a custom option to enable pre-release Pythons (3.10
currently) for testing before they are ABI stable (please don’t release wheels
until that happens). Maybe most exciting, cibuildwheel now supports
configuration in <code>pyproject.toml</code>, allowing you to be even further isolated from
dependence on your CI system; you can easily produce Linux and Windows wheels
locally (macOS still installs to system locations). And, since my
<a href="https://iscinumpy.dev/posts/cibuildwheel-1-9-0">last post</a> and
<a href="https://iscinumpy.dev/posts/overview-of-cibuildwheel">introduction post</a>, cibuildwheel is now part
of the PyPA!</p>pybind11
https://iscinumpy.dev/page/presentations/2021-07-16-scipy/
Fri, 16 Jul 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-07-16-scipy/Announcing CLI11 2.0
https://iscinumpy.dev/post/announcing-cli11-20/
Wed, 14 Jul 2021 14:34:02 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-cli11-20/<p><a href="https://github.com/CLIUtils/CLI11">CLI11</a>, a powerful library for writing beautiful command line interfaces in
C++11, has <a href="https://github.com/CLIUtils/CLI11/releases/tag/v2.0.0">been updated to 2.0</a>. A lot of deprecated things have been
removed, and there was a lot of cleanup under-the-hood; making CLI11 simpler. A
few defaults have changed slightly, like better TOML support by default.</p>
<p>CLI11 does a better job than ever understanding any sort of container you
provide - complex numbers are natively supported, along with atomic types. A
long requested feature, simple version flags, has been added. Subcommands are
more customizable. And there have been quite a few bugfixes for rare issues.</p>Powerful Python Packaging for Scientific Codes
https://iscinumpy.dev/page/presentations/2021-07-08-pyhep/
Thu, 08 Jul 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-07-08-pyhep/High-Performance Histogramming for HEP Analysis
https://iscinumpy.dev/page/presentations/2021-07-07-pyhep/
Wed, 07 Jul 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-07-07-pyhep/Level Up Your Python (part 2)
https://iscinumpy.dev/page/presentations/2021-07-06-pyhep/
Tue, 06 Jul 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-07-06-pyhep/Level Up Your Python (part 1)
https://iscinumpy.dev/page/presentations/2021-07-05-pyhep/
Mon, 05 Jul 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-07-05-pyhep/Python 3.9
https://iscinumpy.dev/post/python-39/
Fri, 12 Feb 2021 12:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-39/<p>Python 3.9 is out (and has been for a while, I’m late posting this), with new
features and changes. The themes for this release have been heavily internal
improvements, such as a new more powerful parser, and the usual static typing
improvements, along with a several bits new-user facing new syntax. This makes
3.9 a smaller release, but still it has some nice features of note.</p>Setup an Apple Silicon Mac
https://iscinumpy.dev/post/setup-apple-silicon/
Thu, 11 Feb 2021 17:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/setup-apple-silicon/<p>I recently got an M1 mac, and I’ll be cataloging my experience with using it for
scientific software development. I’ll be returning to update this page
periodically, and will eventually have a focused recommendation for Apple
Silicon setup, similar to <a href="https://iscinumpy.dev/post/setup-a-new-mac">my Intel setup</a>.</p>🎡 cibuildwheel 1.8.0 and 1.9.0
https://iscinumpy.dev/post/cibuildwheel-1-9-0/
Sun, 07 Feb 2021 20:13:41 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cibuildwheel-1-9-0/<p><a href="https://cibuildwheel.readthedocs.io"><code>cibuildwheel</code></a> has just had two back-to-back releases, two weeks apart,
representing several months of hard work and some exciting few features! I will
be covering both releases at once, so we will discuss Apple Silicon support,
architecture emulation on Linux, integrated PEP 621 Requires-Python support, the
native GitHub Action, extended build and test controls, and more!</p>
<p>If you are following the releases, 1.7.0 came out last November (2020), and
included the fantastic output folding feature, which makes logs much easier to
read on CI systems that support folding, and makes it much easier to see how
long each step takes. The 1.7.x series also included the addition of the
<a href="https://cibuildwheel.readthedocs.io/en/stable/working-examples/">working examples section</a> of the documentation, which tracks
some known projects using <code>cibuildwheel</code>, such as scikit-learn, Matlotlib, and
MyPy; it is a great place to go to look into how other projects have integrated
<a href="https://cibuildwheel.readthedocs.io"><code>cibuildwheel</code></a> into their workflow.</p>
<p>I have an <a href="https://iscinumpy.dev/posts/overview-of-cibuildwheel">general overview post</a> as well. Now
let’s look at what’s new! Update: cibuildwheel is now an official package of the
PyPA!</p>Overview of cibuildwheel 🎡
https://iscinumpy.dev/post/overview-of-cibuildwheel/
Sat, 06 Feb 2021 20:58:16 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/overview-of-cibuildwheel/<p>This is the first of two posts on <a href="https://cibuildwheel.readthedocs.io"><code>cibuildwheel</code></a>, a fantastic project I
joined after switching to it from my own <a href="https://github.com/scikit-hep/azure-wheel-helpers">azure-wheel-helpers</a>, which I’ve
blogged about <a href="https://iscinumpy.dev/post/azure-devops-python-wheels/">here before</a>. It is the best wheelbuilding
system available for Python today, and can make something that is normally a
pain to setup and a headache to maintain a breeze (by forcing all the headaches
on us, of course, as maintainers, but it’s better to solve issues centrally!
Obviously we rather like solving these problems. Or we are just crazy, which is
also possible ;) ).</p>
<p>Be sure to checkout
<a href="https://iscinumpy.dev/posts/cibuildwheel-1-9-0">the followup post over new features in 1.8.0 and 1.9.0</a>,
too! Also, <code>cibuildwheel</code> was recently accepted into the PyPA!</p>CMake: Best Practices
https://iscinumpy.dev/page/presentations/2021-02-02-scrt/
Tue, 02 Feb 2021 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2021-02-02-scrt/pybind11 2.6.0
https://iscinumpy.dev/post/pybind11-2-6-0/
Wed, 21 Oct 2020 15:00:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/pybind11-2-6-0/<figure class="dark"><img src="https://iscinumpy.dev/post/pybind11-2-6-0/images/pybind11-logo.png"
alt="pybind11 logo" width="405">
</figure>
<p>I am pleased to announce the release of <a href="https://github.com/pybind/pybind11/releases/tag/v2.6.0">pybind11 2.6.0</a>! This is the largest
release since 2.2 (released over three years ago). I would like to highlight
some of the key changes below; be sure to check out the <a href="https://pybind11.readthedocs.io/en/latest/changelog.html">changelog</a> and
<a href="https://pybind11.readthedocs.io/en/latest/upgrade.html">upgrade guide</a> for more information! The focus of this release was stability,
packaging, and supporting more platforms, though there are a lot of small
features and useful additions, covered by <a href="https://pybind11.readthedocs.io">newly expanded docs</a>.</p>Making of SciPy 2020's High Performance Histograms as Objects
https://iscinumpy.dev/post/making-of-scipy-2020/
Thu, 13 Aug 2020 12:05:13 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/making-of-scipy-2020/<figure class="dark"><a href="https://www.youtube.com/watch?v=ERraTfHkPd0"><img src="https://iscinumpy.dev/post/making-of-scipy-2020/images/final.png"
alt="Screenshot of SciPy video showing overlay effect" width="80%"></a>
</figure>
<p>Now that SciPy 2020 is over, I would like to share the process I used to create
the talk video. The effect was designed to recreate the feeling of watching an
actual in-person talk. I will first cover parts, detailing what I got and some
general suggestions, then I’ll discuss the filming process, and finally, I will
cover the post-process procedure and software. The entire process took about a
day and a half, with an overnight render, and cost about $200 (best compared to
the cost of registration of a live conference).</p>The boost-histogram Package
https://iscinumpy.dev/page/presentations/2020-07-17-pyhep/
Fri, 17 Jul 2020 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2020-07-17-pyhep/boost-histogram: High-performance histograms as objects
https://iscinumpy.dev/page/presentations/2020-07-07-scipy/
Tue, 07 Jul 2020 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2020-07-07-scipy/Johns Hopkins COVID-19 Dataset in Pandas
https://iscinumpy.dev/post/johns-hopkins-covid/
Mon, 30 Mar 2020 15:30:00 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/johns-hopkins-covid/<p>COVID-19 is ravaging the globe. Let’s look at the excellent Johns Hopkins
dataset using Pandas. This will serve both as a guideline for getting the data
and exploring on your own, as well as an example of Pandas multi-indexing in an easy
to understand situation. I am currently involved in <a href="https://science-responds.org">science-responds</a>.</p>Python, NumPy, and Pandas
https://iscinumpy.dev/page/presentations/2020-01-28-rdm/
Tue, 28 Jan 2020 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2020-01-28-rdm/The boost-histogram beta release
https://iscinumpy.dev/post/boost-histogram-06/
Fri, 13 Dec 2019 11:00:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/boost-histogram-06/<figure class="dark"><img src="https://iscinumpy.dev/post/boost-histogram-06/images/BoostHistogramPythonLogo.png"
alt="boost-histogram logo" width="405">
</figure>
<p>The foundational histogramming package for Python, <a href="https://github.com/scikit-hep/boost-histogram">boost-histogram</a>, hit beta
status with version 0.6! This is a major update to the new <a href="https://github.com/boostorg/histogram">Boost.Histogram</a>
bindings. Since I have not written about boost-histogram yet here, I will
introduce the library in its current state. Version 0.6.2 was based on the
recently released <a href="https://www.boost.org">Boost C++ Libraries</a> <a href="https://www.boost.org/users/history/version_1_72_0.html">1.72</a> Histogram
package. Feel free to <a href="https://boost-histogram.readthedocs.io/en/latest/">visit the docs</a>, or keep reading
this post.</p>
<p>This Python library is part of a larger picture in the <a href="https://scikit-hep.org">Scikit-HEP</a> ecosystem
of tools for Particle Physics and is funded by <a href="https://diana-hep.org">DIANA/HEP</a> and <a href="https://iris-hep.org">IRIS-HEP</a>.
It is the core library for making and manipulating histograms. Other packages
are under development to provide a complete set of tools to work with and
visualize histograms. The <a href="https://github.com/scikit-hep/aghast">Aghast</a> package is designed to convert between
popular histogram formats, and the Hist package will be designed to make common
analysis tasks simple, like plotting via tools such as the <a href="https://github.com/scikit-hep/mplhep">mplhep</a> package.
Hist and Aghast will be initially driven by HEP (High Energy Physics and
Particle Physics) needs, but outside issues and contributions are welcome and
encouraged.</p>High-Performance Python: GPUs
https://iscinumpy.dev/page/presentations/2019-12-05-minicourse/
Thu, 05 Dec 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-12-05-minicourse/High-Performance Python: CPUs
https://iscinumpy.dev/page/presentations/2019-11-20-minicourse/
Wed, 20 Nov 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-11-20-minicourse/Recent developments in histogram libraries
https://iscinumpy.dev/page/presentations/2019-11-07-chep/
Thu, 07 Nov 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-11-07-chep/Python 3.8
https://iscinumpy.dev/post/python-38/
Fri, 25 Oct 2019 14:11:20 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-38/<p>Python 3.8 is out, with new features and changes. The themes for this release
have been performance, ABI/internals, and static typing, along with a smattering
of new syntax. Given the recent
<a href="https://numpy.org/neps/nep-0029-deprecation_policy.html">community statement on Python support</a>,
we should be staying up to date with the current changes in Python. As Python 2
sunsets, we are finally in an era where we can hope to someday use the features
we see coming out of Python release again!</p>Python 3.8: What's new
https://iscinumpy.dev/page/presentations/2019-10-17-pyhep-python38/
Thu, 17 Oct 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-10-17-pyhep-python38/Python Histogramming Packages
https://iscinumpy.dev/page/presentations/2019-10-17-pyhep-hist/
Thu, 17 Oct 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-10-17-pyhep-hist/Boost Histogram Roadmap
https://iscinumpy.dev/page/presentations/2019-09-12-irisretreat/
Thu, 12 Sep 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-09-12-irisretreat/Modern CMake Workshop
https://iscinumpy.dev/page/presentations/2019-08-20-atlas/
Tue, 20 Aug 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-08-20-atlas/Modern CMake
https://iscinumpy.dev/page/presentations/2019-08-14-picscie/
Wed, 14 Aug 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-08-14-picscie/C++20
https://iscinumpy.dev/post/cpp-20/
Sat, 20 Jul 2019 22:42:21 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cpp-20/<p>The final meeting for new features in C++ is over, so let’s explore the new
features in C++, from a data science point of view. This is the largest release
of C++ since C++11, and when you consider C++14 and C++17 to be interim
releases, the entire 9 year cycle is possibly the largest yet! It may not feel
quite as massive as C++11, since we didn’t have interim releases for C++11 and
because C++11 is a much more complete, useful language than C++03, but this is
still a really impactful release! This is also the first version to include
every major feature from Bjarne Stroustrup’s “The design and Evolution of C++”,
also known as D&E, from 1994!</p>
<p>Let’s look at the major new features, as well as collections of smaller ones.</p>Setup a New Mac
https://iscinumpy.dev/post/setup-a-new-mac/
Thu, 18 Jul 2019 11:01:06 -0400[email protected] (Henry Schreiner)https://iscinumpy.dev/post/setup-a-new-mac/<p>Here is a list of my favorite things to do to properly setup macOS for
scientific work. I periodically update it; feel free to leave a comment if
something breaks. This should work on macOS 11 on Intel; see
<a href="https://iscinumpy.dev/post/setup-apple-silicon">my post on Apple Silicon</a> to track progress on a
similar setup.</p>AmpGen & Particle/DecayLanguage
https://iscinumpy.dev/page/presentations/2019-06-19-iris-apd/
Wed, 19 Jun 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-06-19-iris-apd/Histograms
https://iscinumpy.dev/page/presentations/2019-06-19-iris-hist/
Wed, 19 Jun 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-06-19-iris-hist/Azure DevOps: Python Wheels
https://iscinumpy.dev/post/azure-devops-python-wheels/
Tue, 07 May 2019 22:00:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/azure-devops-python-wheels/<p>Note: I now <em>highly</em> recommend <a href="https://cibuildwheel.readthedocs.io">cibuildwheel</a> instead of custom binary wheels.
See <a href="https://scikit-hep.org/developer/gha_pure">GHA Pure Python Wheels</a> and <a href="https://scikit-hep.org/developer/gha_wheels">GHA Binary Wheels</a> for modern methods to
produce wheels on GitHub Actions (directly applicable to Azure, as well, with
minor changes; cibuildwheel works on all most major CI providers).
<a href="https://iscinumpy.dev/tags/cibuildwheel/">See my new posts on cibuildwheel!</a></p>
<p>This is the third post in <a href="https://iscinumpy.dev/categories/azure-devops">a series</a> about Azure
DevOps. This one is about making Python wheels. If you <a href="https://pythonwheels.com">want to play
nice</a> with Python users, or you have a complex build, this will
make your package far more accessible to users. They are faster to install and
to use and more secure. We will quickly cover making universal wheels, then we
will move on to fully compiled binaries, including C++14, manylinux2010, and
other hot topics. This series was developed to update the testing and releasing
of Python packages for <a href="http://scikit-hep.org">Scikit-HEP</a>. The results of this tutorial can be seen
in the <a href="https://github.com/scikit-hep/boost-histogram">boost-histogram</a> repository, under the <code>.ci</code> folder.</p>Azure DevOps: Releases
https://iscinumpy.dev/post/azure-devops-releases/
Tue, 07 May 2019 21:00:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/azure-devops-releases/<p>This is the second post in <a href="https://iscinumpy.dev/categories/azure-devops">a series</a> about Azure
DevOps. This one is about release pipelines; if you use Azure to build packages
(like binaries, etc.), how do you push them to a final endpoint? In this
example, we will be building a simple pure Python package, and pushing the
result to Test-PyPI. You can adapt it to your situation, however. The
<a href="https://iscinumpy.dev/post/azure-devops-python-wheels">third post</a> will cover building Python
binaries. This series was developed to update the testing and releasing of
Python packages for <a href="http://scikit-hep.org">Scikit-HEP</a>. Several of the projects in SciKit-HEP are
using release pipelines, include <a href="https://github.com/scikit-hep/boost-histogram">boost-histogram</a> and <a href="https://github.com/scikit-hep/particle">Particle</a>.</p>
<p>Note: I now highly recommend GitHub Actions, which is almost “Azure 2.0”. You
can read my tutorials on GitHub Actions on the <a href="https://scikit-hep.org/developer/gha_basic">Scikit-HEP developer pages</a>.
The release process, in particular, is simpler, and you still get the benefit of
artifacts.</p>Azure DevOps: Introduction
https://iscinumpy.dev/post/azure-devops-intro/
Tue, 07 May 2019 20:00:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/azure-devops-intro/<p>Continuous Integration (CI) is fantastic for software development and
deployment. One of the newest entries into the CI market<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> is Microsoft’s
<a href="https://azure.microsoft.com/en-us/services/devops/">Azure DevOps</a>. Their Open Source support is impressive; it is likely part of
the recent push<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> by Microsoft to be more Open Source friendly. Open Source
projects get 10 parallel builds, unlimited build minutes, 6 hour job timeouts,
and incredibly fast jobs on macOS, Linux, and Windows, all via a single
platform. Quite a few major projects<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> have been moving to Azure since the
initial release in December 2018. The configuration of DevOps is second only to
GitLab CI in ease of use and possibly the most expressive system available. The
multiple pipeline support also scales well to complicated procedures.</p>
<p>This is the first in <a href="https://iscinumpy.dev/categories/azure-devops">a series</a> of posts covering an
introduction to setting up projects in Azure DevOps, developed to update the
testing and releasing of Python packages for <a href="http://scikit-hep.org">Scikit-HEP</a>, a project for a
coherent High Energy Physics Python analysis toolset. The
<a href="https://iscinumpy.dev/post/azure-devops-releases">second post</a> covers release pipelines, and the
<a href="https://iscinumpy.dev/post/azure-devops-python-wheels">third</a> covers building binary Python packages
using DevOps.</p>
<p>Note: I now highly recommend GitHub Actions, which is almost “Azure 2.0”, if you
are interested in setting up CI. The language is very similar, although
simplified, with some non-backward compatible bugfixes (such as multiline
expressions will error if any line files, instead of just on the last line in
Azure). You can read my tutorials on GitHub Actions on the <a href="https://scikit-hep.org/developer/gha_basic">Scikit-HEP developer
pages</a>.</p>A hybrid deep learning approach to vertexing
https://iscinumpy.dev/page/presentations/2019-04-17-iml/
Wed, 17 Apr 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-04-17-iml/boost-histogram and hist
https://iscinumpy.dev/page/presentations/2019-04-15-iris/
Mon, 15 Apr 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-04-15-iris/A hybrid deep learning approach to vertexing
https://iscinumpy.dev/page/presentations/2019-04-03-ctd/
Wed, 03 Apr 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-04-03-ctd/Conda: a complete reproducible ROOT environment in under 5 minutes
https://iscinumpy.dev/page/presentations/2019-03-21-how-conda/
Thu, 21 Mar 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-03-21-how-conda/Machine Learning for the Primary Vertex reconstruction
https://iscinumpy.dev/page/presentations/2019-03-20-how-ml/
Wed, 20 Mar 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-03-20-how-ml/A hybrid deep learning approach to vertexing
https://iscinumpy.dev/page/presentations/2019-03-11-acat/
Mon, 11 Mar 2019 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2019-03-11-acat/ROOT on Conda Forge
https://iscinumpy.dev/post/root-conda/
Wed, 13 Feb 2019 10:18:37 +0100[email protected] (Henry Schreiner)https://iscinumpy.dev/post/root-conda/<p>For High Energy Physics, the go-to framework for big data analysis has been
CERN’s <a href="https://root.cern">ROOT</a> framework. ROOT is a massive C++ library that even predates the
STL in some areas. It is<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> <em>also</em> a JIT C++ interpreter called Cling, probably
the best in the business. If you have
<a href="https://andersy005.github.io/blog/2018/01/20/play-interactively-with-cpp-getting-started-with-xeus-cling/">heard of</a>
the <a href="https://github.com/QuantStack/xeus-cling">Xeus</a> C++ Kernel for Jupyter, that is built on top of Cling. ROOT has
everything a HEP physicist could want: math, plotting, histograms, tuple and
tree structures, a very powerful file format for IO, machine learning, Python
bindings, and more. It also does things like dictionary generation and arbitrary
class serialization (other large frameworks like <a href="https://qt.io">Qt</a> have similar generation
tools).</p>
<p>You may already be guessing one of the most common problems for ROOT. It is huge
and difficult to install – if you build from source, that’s a several hour task
on a single core. It has gotten <a href="https://root.cern/install/">much better</a> in the
last 6 years, and there are several places you can find ROOT, but there are
still areas where it is challenging. This is especially true for Python; ROOT is
linked to your distro’s Python (both python2 and python3 if your distro supports
it, as of ROOT 6.22); but the common rule for using Python is “don’t touch your
system Python” - so modern Python users should be in a virtual environment, and
for that ROOT requires the system site-packages option be enabled, which is not
always ideal. And, if you use the <a href="https://www.anaconda.com/distribution/">Anaconda Python distribution</a>,
which is the most popular scientific distribution of Python and massively
successful for ML frameworks, the general rule even for people who build ROOT
themselves has been: don’t. But now, you can get a fully featured ROOT binary
package for macOS or Linux, Python 2.7, 3.6, 3.7, or 3.8 from <a href="https://conda-forge.org">Conda-Forge</a>,
the most popular Anaconda community channel! Many more HEP recipes have now been
added to Conda-Forge, as well! ROOT now also provides a <a href="https://root.cern/new-docker-images/">conda docker image</a>,
too!</p>ROOT Install Options
https://iscinumpy.dev/post/root-install/
Mon, 04 Feb 2019 10:44:37 +0100[email protected] (Henry Schreiner)https://iscinumpy.dev/post/root-install/<p>For particle physicists, ROOT is one of the most important toolkits around. It
is a huge suite of tools that predates the C++ standard library, and has almost
anything a particle physicist could want. It has driven developments in other
areas too. ROOT’s current C++ interpreter, CLING, is the most powerful C++
interpreter available and is used by the Xeus project for Jupyter. The Python
work has helped PyPy, with CPPYY also coming from ROOT. However, due to the
size, complexity, and age of some parts of ROOT, it can be a bit challenging to
install; and it is even more challenging when you want it to talk to Python. I
would like to point to the brand-new Conda-Forge ROOT package for Linux and
macOS, and point out a few other options for macOS installs. Note for Windows
users: Due to the fact that ROOT expects the type <code>long</code> to match the system
pointer size, 64-bit Windows cannot be supported for quite some time. While you
can use it in 32 bit form, this is generally impossible to connect to Python,
which usually will be a 64-bit build.</p>Illustrations and videos
https://iscinumpy.dev/page/illustrations/
Mon, 10 Dec 2018 11:32:00 +0100[email protected] (Henry Schreiner)https://iscinumpy.dev/page/illustrations/<p>These are some illustrations and videos that I have made over the years.</p>Histogram Speeds in Python
https://iscinumpy.dev/post/histogram-speeds-in-python/
Thu, 01 Nov 2018 14:58:09 +0100[email protected] (Henry Schreiner)https://iscinumpy.dev/post/histogram-speeds-in-python/<p>Let’s compare several ways of making Histograms. I’m going to assume you would
like to end up with a nice OO histogram interface, so all the 2D methods will
fill a Physt histogram. We will be using a 2 x 1,000,000 element array and
filling a 2D histogram, or 10,000,000 elemends in a 1D histogram. Binnings are
regular.</p>
<h4 id="1d-10000000-item-histogram">1D 10,000,000 item histogram</h4>
<table>
<thead>
<tr>
<th>Example</th>
<th>KNL</th>
<th>MBP</th>
<th>X24</th>
</tr>
</thead>
<tbody>
<tr>
<td>NumPy: histogram</td>
<td>704 ms</td>
<td>147 ms</td>
<td>114 ms</td>
</tr>
<tr>
<td>NumPy: bincount</td>
<td>432 ms</td>
<td>110 ms</td>
<td>117 ms</td>
</tr>
<tr>
<td>fast-histogram</td>
<td>337 ms</td>
<td>45.9 ms</td>
<td>45.7 ms</td>
</tr>
<tr>
<td>Numba</td>
<td>312 ms</td>
<td>58.8 ms</td>
<td>60.7 ms</td>
</tr>
</tbody>
</table>
<h4 id="2d-1000000-item-histogram">2D 1,000,000 item histogram</h4>
<table>
<thead>
<tr>
<th>Example</th>
<th>KNL</th>
<th>MBP</th>
<th>X24</th>
</tr>
</thead>
<tbody>
<tr>
<td>Physt</td>
<td>1.21 s</td>
<td>293 ms</td>
<td>246 ms</td>
</tr>
<tr>
<td>NumPy: histogram2d</td>
<td>456 ms</td>
<td>114 ms</td>
<td>88.3 ms</td>
</tr>
<tr>
<td>NumPy: add.at</td>
<td>247 ms</td>
<td>62.7 ms</td>
<td>49.7 ms</td>
</tr>
<tr>
<td>NumPy: bincount</td>
<td>81.7 ms</td>
<td>23.3 ms</td>
<td>20.3 ms</td>
</tr>
<tr>
<td>fast-histogram</td>
<td>53.7 ms</td>
<td>10.4 ms</td>
<td>7.31 ms</td>
</tr>
<tr>
<td>fast-hist threaded 0.5</td>
<td>(6) 62.5 ms</td>
<td>9.78 ms</td>
<td>(6) 15.4 ms</td>
</tr>
<tr>
<td>fast-hist threaded (m)</td>
<td>62.3 ms</td>
<td>4.89 ms</td>
<td>3.71 ms</td>
</tr>
<tr>
<td>Numba</td>
<td>41.8 ms</td>
<td>10.2 ms</td>
<td>9.73 ms</td>
</tr>
<tr>
<td>Numba threaded</td>
<td>(6) 49.2 ms</td>
<td>4.23 ms</td>
<td>(6) 4.12 ms</td>
</tr>
<tr>
<td>Cython</td>
<td>112 ms</td>
<td>12.2 ms</td>
<td>11.2 ms</td>
</tr>
<tr>
<td>Cython threaded</td>
<td>(6) 128 ms</td>
<td>5.68 ms</td>
<td>(8) 4.89 ms</td>
</tr>
<tr>
<td>pybind11 sequential</td>
<td>93.9 ms</td>
<td>9.20 ms</td>
<td>17.8 ms</td>
</tr>
<tr>
<td>pybind11 OpenMP atomic</td>
<td>4.06 ms</td>
<td>6.87 ms</td>
<td>1.91 ms</td>
</tr>
<tr>
<td>pybind11 C++11 atomic</td>
<td>(32) 10.7 ms</td>
<td>7.08 ms</td>
<td>(48) 2.65 ms</td>
</tr>
<tr>
<td>pybind11 C++11 merge</td>
<td>(32) 23.0 ms</td>
<td>6.03 ms</td>
<td>(48) 4.79 ms</td>
</tr>
<tr>
<td>pybind11 OpenMP merge</td>
<td>8.74 ms</td>
<td>5.04 ms</td>
<td>1.79 ms</td>
</tr>
</tbody>
</table>PV finding with CNNs
https://iscinumpy.dev/page/presentations/2018-09-26-lhcb/
Wed, 26 Sep 2018 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2018-09-26-lhcb/iminuit: interactive python wrapper around MINUIT2
https://iscinumpy.dev/page/presentations/2018-09-12-root/
Wed, 12 Sep 2018 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2018-09-12-root/A Python upgrade to the GooFit package for parallel fitting
https://iscinumpy.dev/page/presentations/2018-07-09-chep/
Mon, 09 Jul 2018 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2018-07-09-chep/Binding Minuit2
https://iscinumpy.dev/post/binding-minuit2/
Sat, 07 Jul 2018 21:00:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/binding-minuit2/<p>Let’s try a non-trivial example of a binding: Minuit2 (6.14.0 standalone
edition).</p>Tools to Bind to Python
https://iscinumpy.dev/post/tools-to-bind-to-python/
Sat, 07 Jul 2018 21:00:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/tools-to-bind-to-python/<p>This was originally given as a PyHEP 2018 talk, It is designed to be
interactive, and can be run in SWAN if you have a CERN account. If you want to
run it manually, just download the repository:
<a href="https://github.com/henryiii/pybindings_cc">github.com/henryiii/pybindings_cc</a>.
It is easy to run in Anaconda.</p>Tools to bind to Python
https://iscinumpy.dev/page/presentations/2018-07-07-pyhep2018/
Sat, 07 Jul 2018 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2018-07-07-pyhep2018/Announcing CLI11 1.6
https://iscinumpy.dev/post/announcing-cli11-16/
Wed, 27 Jun 2018 14:44:40 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-cli11-16/<p><a href="https://github.com/CLIUtils/CLI11">CLI11</a>, a powerful library for writing beautiful command line interfaces in
C++11, has <a href="https://github.com/CLIUtils/CLI11/releases">been updated to 1.6</a>, the largest update ever. CLI11
output is more customizable than ever, and has a better functionality separation
under the hood.</p>
<p>CLI11 has had the formatting system completely redesigned, with minor or
complete customization of the output possible. Configuration files reading and
writing also can be configured; a new example with json instead of ini
formatting is included. Validators (finally) have custom help output, as well.
Many odd corner cases have been made possible, such as interleaving options.</p>CMake 3.11
https://iscinumpy.dev/post/cmake-311/
Mon, 02 Apr 2018 11:16:57 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cmake-311/<p>CMake 3.11 was just released; this is particularly exciting release for CMake.
I’d like to give a quick and friendly introduction to the new features that
might make the largest difference for CMake users.</p>Announcing GooFit 2.1
https://iscinumpy.dev/post/announcing-goofit-21/
Thu, 07 Dec 2017 03:20:00 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-goofit-21/<p><img src="https://iscinumpy.dev/images/post/2017/GooFitLogo21small.png" alt="GooFit logo"></p>
<p>GooFit 2.1 introduces the full-featured Python bindings to GooFit. These
bindings mimic the C++ usage of GooFit, including bindings for all PDFs, and
also provide NumPy-centric conversions, live Jupyter notebook printing, pip
install, and more. Most of the examples in C++ are provided in Python form, as
well.</p>
<p>Several other API changes were made. Observables are now distinguished from
Variables and provided as a separate class. Both these classes are now passed
around by copy everywhere.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> The three and four body amplitude classes have
been refactored and simplified. OpenMP is now supported via homebrew on macOS;
GooFit is one of the only packages that currently can build with OpenMP on the
default macOS compiler. Eigen is now available, and <a href="https://github.com/CLIUtils/CLI11">CLI11</a> has been updated to
version 1.3.</p>
<p>GooFit 2.1 will receive continuing support while development on GooFit 2.2
presses on with a new indexing scheme for PDFs.</p>My Software
https://iscinumpy.dev/page/software/
Wed, 06 Dec 2017 13:17:33 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/page/software/<h2 id="my-projects">My projects</h2>
<p>Besides being an admin at <a href="https://scikit-hep.org">Scikit-HEP</a>, and active in conda-forge and
homebrew, these are some of the projects I work on directly:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://pybind11.readthedocs.io">pybind11</a></td>
<td>Binding C++11+ and Python beautifully.</td>
</tr>
<tr>
<td><a href="https://cibuildwheel.readthedocs.io">cibuildwheel</a></td>
<td>Create Python wheels beautifully.</td>
</tr>
<tr>
<td><a href="https://github.com/scikit-hep/boost-histogram">boost-histogram</a></td>
<td>Histograms in Python based on Boost.Histogram for C++14.</td>
</tr>
<tr>
<td><a href="https://github.com/CLIUtils/CLI11">CLI11</a></td>
<td>A powerful but easy to use C++11 command line interface parser.</td>
</tr>
<tr>
<td><a href="https://github.com/scikit-hep/particle">Particle</a></td>
<td>Particle descriptions in Python.</td>
</tr>
<tr>
<td><a href="https://github.com/scikit-hep/decaylanguage">DecayLanguage</a></td>
<td>Decay chains in Python.</td>
</tr>
<tr>
<td><a href="https://plumbum.readthedocs.io/en/latest">Plumbum</a></td>
<td>A shell tools library for Python, with color, ssh, paths, cli, and more.</td>
</tr>
<tr>
<td><a href="https://github.com/GooFit/GooFit">GooFit</a></td>
<td>An OpenMP/CUDA powered fitting library.</td>
</tr>
<tr>
<td><a href="https://github.com/iris-hep/jekyll-indico">Jekyll-Indico</a></td>
<td>A plugin to collect Indico meetings for Jekyll, written in Ruby.</td>
</tr>
<tr>
<td><a href="https://github.com/conda-forge/root-feedstock">Conda-Forge ROOT</a></td>
<td>A project that did the impossible: make ROOT a conda package!</td>
</tr>
<tr>
<td><a href="https://github.com/utgwkk/pytest-github-actions-annotate-failures">pytest-github-actions-annotate-failures</a></td>
<td>A utility to convert pytest errors to annotations in GitHub Actions.</td>
</tr>
</tbody>
</table>
<p>Classic or smaller historic projects:</p>Include What You Use
https://iscinumpy.dev/post/include-what-you-use/
Tue, 05 Dec 2017 14:06:35 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/include-what-you-use/<p>Include-what-you-use is a promising little tool for cleaning up a codebase. It
didn’t end up working for the use I had for it, but it still could be useful.
Here is a quick guideline on installing it on macOS.</p>Comparing CLI11 and Boost PO
https://iscinumpy.dev/post/comparing-cli11-and-boostpo/
Sun, 03 Dec 2017 16:31:50 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/comparing-cli11-and-boostpo/<p>CLI11 started years ago as a set of tools built on Boost Program Options (PO),
and has since matured into the powerful, easy-to-use stand-alone library it is
available today. If you would like to see the original inspiration for CLI11,
look at
<a href="https://github.com/CLIUtils/CLI11/blob/v0.1/include/Program.hpp">Program.hpp in CLI11 0.1</a>.
The rest of the post will focus on a comparison between making a CLI app in the
two libraries. I am going to assume that you are preparing fairly basic but
non-trivial programs in the following comparison.</p>
<p><strong>TL;DR:</strong> CLI11 is more concise, and provides more control with better defaults
in many cases, but was inspired by Boost PO.</p>Announcing CLI11 1.3
https://iscinumpy.dev/post/announcing-cli11-13/
Fri, 01 Dec 2017 09:03:50 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-cli11-13/<p><a href="https://github.com/CLIUtils/CLI11">CLI11</a>, a powerful library for writing beautiful command line interfaces in
C++11, has <a href="https://github.com/CLIUtils/CLI11/releases">been updated to 1.3</a>, the largest update ever. CLI11 is
more powerful than ever, and has simpler and more consistent parsing under the
hood.</p>
<p>This version focused on refactoring several key systems to ensure correct
behavior in the interaction of different settings. Most caveats about features
only working on the main App have been addressed, and extra arguments have been
reworked. Inheritance of defaults makes configuring CLI11 much easier without
having to subclass. Policies add new ways to handle multiple arguments to match
your favorite CLI programs. Error messages and help messages are better and more
flexible. Several bugs and odd behaviors in the parser have been fixed.</p>Watching GitHub Releases
https://iscinumpy.dev/post/watching-github-releases/
Tue, 28 Nov 2017 16:54:14 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/watching-github-releases/<p>If you use an RSS feed reader, you can watch all your favorite GitHub
repositories for new releases! Just follow:</p>
<pre tabindex="0"><code>https://github.com/USER/REPO/releases.atom
</code></pre><p>You can see a long discussion with other options
<a href="https://github.com/isaacs/github/issues/410#issuecomment-163761492">here</a>.</p>OpenMP on High Sierra
https://iscinumpy.dev/post/omp-on-high-sierra/
Mon, 13 Nov 2017 15:41:35 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/post/omp-on-high-sierra/<p>Building OpenMP code is actually possible using Apple Clang that comes default
with macOS’s Xcode! Although Apple does not build the OpenMP library, the
compiler still supports it. In this post, I demonstrate the procedure necessary
to include OpenMP in your build, both with the new support in CMake 3.12, as
well as how it would be done without it.</p>Writing
https://iscinumpy.dev/page/writing/
Fri, 10 Nov 2017 22:08:21 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/page/writing/<h2 id="gitjupyter-books">Git/Jupyter Books</h2>
<p>Here is a list of GitBooks that I have either written or helped write:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://henryiii.github.io/level-up-your-python">Level Up Your Python</a></td>
<td>Intermediate to advanced Python, for a Princeton Research Computing Workshop.</td>
</tr>
<tr>
<td><a href="https://cliutils.gitlab.io/modern-cmake/">Modern CMake</a></td>
<td>A fantastic, up-to-date resource for CMake the way it should be.</td>
</tr>
<tr>
<td><a href="https://github.com/henryiii/compclass">CompClass</a></td>
<td>Computational Science in Python course given at the University of Cincinnati, Fall 2018.</td>
</tr>
<tr>
<td><a href="https://lhcb.github.io/developkit-lessons/first-development-steps/">DevelopKit</a></td>
<td>Developing software in LHCb’s Run 3.</td>
</tr>
<tr>
<td><a href="https://cliutils.gitlab.io/plugin-term">GitBook Plugin - Term</a></td>
<td>A powerful terminal formatting plugin (used in other GitBooks).</td>
</tr>
<tr>
<td><a href="https://cliutils.github.io/CLI11/book/">CLI11 Tutorial</a></td>
<td>Command line parsing made beautiful.</td>
</tr>
<tr>
<td><a href="https://goofit.gitlab.io/root-tutorial">UC ROOT Tutorial</a></td>
<td>Basic ROOT for HEP, conversion from old material.</td>
</tr>
<tr>
<td><a href="https://goofit.gitlab.io/Goo2Torial">GooFit 2Torial</a></td>
<td>Using GooFit, writing GooFit.</td>
</tr>
</tbody>
</table>
<h2 id="tutorials-and-workshops">Tutorials and workshops</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://hsf-training.github.io/hsf-training-cmake-webpage/">HSF Modern CMake workshop</a></td>
<td>Workshop on CMake for ATLAS students at LBNL.</td>
</tr>
<tr>
<td><a href="https://github.com/henryiii/python-performance-minicourse">Python CPU minicourse</a></td>
<td>Minicourse for high-performance CPU programming.</td>
</tr>
<tr>
<td><a href="https://github.com/henryiii/pygpu-minicourse">Python GPU minicourse</a></td>
<td>Minicourse for GPU programming.</td>
</tr>
<tr>
<td><a href="https://github.com/henryiii/pandas-notebook">Pandas demo</a></td>
<td>Demo of Pandas.</td>
</tr>
</tbody>
</table>
<h2 id="websites">Websites</h2>
<p>These are websites I have either created or worked on.</p>About the author
https://iscinumpy.dev/page/about/
Tue, 10 Oct 2017 14:17:15 -0500[email protected] (Henry Schreiner)https://iscinumpy.dev/page/about/<p>Henry Schreiner is a Computational Physicist / Research Software Engineer in
High Energy Physics at Princeton University. He specializes in the interface
between high-performance compiled codes and interactive computation in Python,
in software distribution, and in interface design. He has previously worked on
computational cosmic-ray tomography for archaeology and high performance GPU
model fitting. He is currently a member of the IRIS-HEP project, developing
tools for the next era of the Large Hadron Collider (LHC).</p>Goofit 2.0
https://iscinumpy.dev/page/presentations/2017-08-22-acat2017/
Tue, 22 Aug 2017 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2017-08-22-acat2017/Recent developments in GooFit
https://iscinumpy.dev/page/presentations/2018-02-12-diana-goofit/
Tue, 22 Aug 2017 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2018-02-12-diana-goofit/GPUs in LHCb for Analysis
https://iscinumpy.dev/page/presentations/2017-08-03-dpf2017/
Thu, 03 Aug 2017 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2017-08-03-dpf2017/Modernizing GooFit: A Case Study
https://iscinumpy.dev/page/presentations/2017-07-12-pearc17/
Wed, 12 Jul 2017 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2017-07-12-pearc17/Announcing GooFit 2.0
https://iscinumpy.dev/post/announcing-goofit-20/
Thu, 08 Jun 2017 17:54:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-goofit-20/<p>The next version of the premier CUDA/OpenMP fitting program for HEP analysis,
GooFit 2.0, <a href="GooFit">has been released</a>. GooFit is now easy to build on a wide
variety of Unix systems, and supports debuggers and IDEs. GooFit is faster, has
unit tests, and working examples. More PDFs and examples have been added, as
well as newly released example datasets that are downloaded automatically.
GooFit now has built in support for MPI, and can use that to deploy to multiple
graphics cards on the same machine. A new command line parser (<a href="https://github.com/CLIUtils/CLI11">CLI11</a>) and
drastically improved logging and errors have made code easier to write and
debug. Usage of GooFit specific terminology is now reduced, using standard
Thrust or CUDA terms when possible, lowering the barrier for new developers. A
new Python script has been added to assist users converting from pre 2.0 code.</p>
<p>The file structure of GooFit and the build system have been completely revamped.
The fake <code>nvcc</code> features have been removed, as have the <code>rootstuff</code> copies of
ROOT classes. PDFs are now organized by type and compile and link separately.
Multiple PDF caching support has improved. The build system now uses CMake and
manages external libraries.</p>
<p>A new feature of the CMake build system is GooFit Packages, which are complete
packages that can be added to GooFit and built, allowing analysis code to live
in a separate location from GooFit, rather than the old method of simply forking
GooFit and adding your analysis manually. A GooFit Package can be made into an
example trivially. See <a href="https://github.com/maddocbf/goofit_KKPiPi">this package</a>
for an example.</p>
<p>GooFit 2.0 will receive continuing support while development on GooFit 2.1
presses on.</p>
<h4 id="links">Links:</h4>
<p><a href="https://github.com/GooFit/GooFit">GooFit on GitHub</a> • <a href="https://GooFit.github.io">GooFit webpage</a> • <a href="https://GooFit.github.io/GooFit">API documentation</a></p>Announcing CLI11 Version 1.0
https://iscinumpy.dev/post/announcing-cli11-10/
Thu, 01 Jun 2017 14:05:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/announcing-cli11-10/<p>CLI11, a powerful library for writing command line interfaces in C++11, has just
been released. There are no requirements beyond C++11 support (and even
<code><regex></code> support not required). It works on Mac, Linux, and Windows, and has
100% test coverage on all three systems. You can simply drop in a single header
file (<code>CLI11.hpp</code> available in <a href="https://github.com/CLIUtils/CLI11/releases">releases</a>) to use CLI11 in your own application.
Other ways to integrate it into a build system are listed in the <a href="https://github.com/CLIUtils/CLI11/blob/master/README.md">README</a>.</p>
<p>The library was inspired the Python libraries <a href="http://plumbum.readthedocs.io/en/latest/">Plumbum</a> and <a href="http://click.pocoo.org/5/">Click</a>, and
incorporates many of their user friendly features. The library is extensively
documented, with a <a href="https://github.com/CLIUtils/CLI11/blob/master/README.md">friendly introduction</a>, a tutorial filled (in
progress) <a href="https://cliutils.gitlab.io/CLI11">GitBook</a>, and more technical <a href="https://cliutils.github.io/CLI11">API docs</a>.</p>CLI11
https://iscinumpy.dev/page/presentations/2017-04-24-diana-cli11/
Mon, 24 Apr 2017 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/presentations/2017-04-24-diana-cli11/Perfect forwarding for methods
https://iscinumpy.dev/post/perfect-forwarding-for-methods/
Fri, 17 Mar 2017 10:43:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/perfect-forwarding-for-methods/<p>I often see perfect forwarding listed for constructor arguments, but not usually
for functions with a return or methods. Here is my solution for an method method
of class <code>Cls</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cpp" data-lang="cpp"><span class="line"><span class="cl"><span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="p">...</span><span class="n">Args</span><span class="o">></span>
</span></span><span class="line"><span class="cl"><span class="k">static</span> <span class="k">auto</span> <span class="n">method</span><span class="p">(</span><span class="n">Cls</span><span class="o">*</span> <span class="n">cls</span><span class="p">,</span> <span class="n">Args</span> <span class="o">&&</span> <span class="p">...</span><span class="n">args</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="o">-></span> <span class="k">typename</span> <span class="n">std</span><span class="o">::</span><span class="n">result_of</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="o">&</span><span class="n">Cls</span><span class="o">::</span><span class="n">method</span><span class="p">)(</span><span class="n">Cls</span><span class="p">,</span> <span class="n">Args</span><span class="p">...)</span><span class="o">>::</span><span class="n">type</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">cls</span><span class="o">-></span><span class="n">method</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="n">Args</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>This is useful if you want to call protected classes from a “helper” friend
class, for example, to expose them to tests without having to require
GoogleTest/GoogleMock to be available for regular users.</p>Setting up SSH forwarding
https://iscinumpy.dev/post/setting-up-ssh-forwarding/
Wed, 01 Mar 2017 10:49:33 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/post/setting-up-ssh-forwarding/<p>SSH forwarding can improve your security along with reducing the need to type
passwords and have multiple keys linked to your GitHub/GitLab instance. The
procedure is:</p>Lua Environment Modules
https://iscinumpy.dev/post/lua-environment-modules/
Wed, 11 Jan 2017 06:08:00 -0800[email protected] (Henry Schreiner)https://iscinumpy.dev/post/lua-environment-modules/<p>This is a guide to setting up Lmod (lua environment modules) on a CentOS system.
I’ve used a similar procedure to set them up on a Mac, as well, so this is still
a useful guide to the workings of Lmod if you use a different system; mostly
paths will change. On a Mac, you’ll want to install <code>Lmod</code> from the <code>science</code>
tap in <code>brew</code>. There are several good pages covering environment modules (TCL
version), but not many that use the newer Lua syntax. This document aims to fill
that roll.</p>Python 3 upgrade
https://iscinumpy.dev/post/python-3-upgrade/
Wed, 12 Oct 2016 08:30:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/python-3-upgrade/<p>About ten years ago, Guido Van Rossum, the Python author and Benevolent Dictator
for Life (BDFL), along with the Python community, decided to make several
concurrent backward incompatible changes to Python 2.5 and release a new
version, Python 3.0.</p>C++17
https://iscinumpy.dev/post/cpp-17/
Sat, 10 Sep 2016 08:30:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cpp-17/<p>The every-three-year cycle has changed the development of C++; we are now
getting consistent releases somewhere in-between the major and minor releases of
old. The 2017 release may be called minor by some, with a huge portion of the
planned improvements being pushed back another 3-6 years, but there were several
substantial changes in useful areas; it is much more impactful than C++14, for
example. This almost feels like a lead-in release to C++20.</p>
<p>The <code>std::variant</code>, <code>std::optional</code>, and <code>std::any</code> additions to the standard
library are huge, and can restructure the way you program (and are available for
older C++ releases through Boost and other libraries).</p>C++14
https://iscinumpy.dev/post/cpp-14/
Fri, 09 Sep 2016 08:30:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cpp-14/<p>Unlike C++11, this is a minor release, focused mostly on improvements on top of
C++11 changes, with very little that one could call “new”. C++14 feels a little
more natural than C++11 by expanding the usage of features and implementing
common sense additions that were missed in the original C++11 release. There
were also quite a few bug fixes; several of these were backported into C++11
mode in compilers.</p>
<p>Also, while C++11 is always available in ROOT 6, C++14 requires a flag and
compatible compiler, so C++14 features are often unavailable. The Conda-Forge
ROOT package has C++17 enabled.</p>C++11
https://iscinumpy.dev/post/cpp-11/
Thu, 08 Sep 2016 08:30:00 +0200[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cpp-11/<p>C++11 was the largest change ever made to C++; and due to the changed release
schedule, probably will remain the largest single change. It is a well thought
out, mostly backward-compatible change that can cause you to completely rethink
the way you write code in C++. It is best thought of as almost a new language, a
sort of (C++)++ language. There are too many changes to list here, and there are
excellent resources available, so this is meant to just give you a taste of some
of the most useful changes.</p>
<p>Many of the features work best together, or are related. There already are great
resources for learning about C++11 (listed at the bottom of this lesson), and
C++11 is already in use in most software. Therefore, the remainder of this
lesson will cover a few of the common idioms in C++11 that a programmer
experienced with the older C++ might not immediately think of.</p>GoogleTest and CMake
https://iscinumpy.dev/post/googletest-and-cmake/
Fri, 25 Mar 2016 16:12:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/googletest-and-cmake/<p>This is a quick recipe for setting up CMake to use googletest in your projects.
First, make a <code>tests</code> folder in the root of your project. Then, add
<code>add_subdirectory(tests)</code> to your <code>CMakeLists.txt</code>, after you’ve finished adding
the libraries in your project. Note that the way I’ve written this probably
requires CMake 3.4+.</p>A simple introduction to asyncio
https://iscinumpy.dev/post/a-simple-introduction-to-asyncio/
Thu, 19 Nov 2015 09:46:00 -0800[email protected] (Henry Schreiner)https://iscinumpy.dev/post/a-simple-introduction-to-asyncio/<p>This is a simple explanation of the <code>asyncio</code> module and new supporting language
features in Python 3.5. Even though the new keywords <code>async</code> and <code>await</code> are new
language constructs, they are mostly<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> useless without an event loop, and that
is supplied in the standard library as <code>asyncio</code>. Also, you need awaitable
functions, which are only supplied by <code>asyncio</code> (or in the growing set of async
libraries, like <code>asyncssh</code>, <code>quamash</code> etc.).</p>A little example of how asyncio works
https://iscinumpy.dev/post/a-little-example-of-how-asyncio-works/
Thu, 19 Nov 2015 09:43:00 -0800[email protected] (Henry Schreiner)https://iscinumpy.dev/post/a-little-example-of-how-asyncio-works/<p>This is a simple example to show how Asyncio works without using Asyncio itself,
instead using a basic and poorly written event loop. This is only meant to give
a flavor of what Asyncio does behind the curtains. I’m avoiding most details of
the library design, like callbacks, just to keep this simple. Since this is
written as an illustration, rather than real code, I’m going to dispense with
trying to keep it 2.7 compatible.</p>Feynman Diagrams in Tikz
https://iscinumpy.dev/post/feynman-diagrams-in-tikz/
Fri, 30 Oct 2015 07:02:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/feynman-diagrams-in-tikz/<p>There is a package for making Feynman diagrams in LaTeX. Unfortunately, it is
old and <code>dvi</code> latex only. If you are using pdflatex or lualatex, as you should
be, it does not work. Even in regular LaTeX, it’s a bit of a pain. Why is there
not a new package for pdflatex? Turns out, you don’t need one. Due to the
powerful drawing library Tikz, you can create any diagram easily, and can
customize it completely. For example:</p>
<figure class="center"><img src="https://iscinumpy.dev/images/post/2015/fd_color.png"
alt="Example diagram" width="50%">
</figure>Including CRY cosmic ray generator in CMake
https://iscinumpy.dev/post/cry-cosmic-ray-generator-in-cmake/
Mon, 19 Oct 2015 09:07:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/cry-cosmic-ray-generator-in-cmake/<p>I realized that CRY did not have a CMake based install option, so including it
in a GEANT4 cmake project might not be obvious. This is how you would do it in
your CMakeLists.txt:</p>GTest Submodule
https://iscinumpy.dev/post/gtest-submodule/
Wed, 07 Oct 2015 06:43:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/gtest-submodule/<blockquote>
<p>Note: There is a better way to do this described
<a href="https://iscinumpy.dev/post/googletest-and-cmake">here</a>.</p>
</blockquote>
<p>If you’ve ever tried <code>apt-get</code> or <code>brew</code> to try to install gtest, you are
probably familiar with the fact that gtest is not “recommend” for global install
on your system. As an alternative, the recommendation is that you make it part
of your project. The process for making gtest part of your project, however, is
not well documented, at least for modern git projects. What follows is the
procedure I used to do so.</p>Slots in Python
https://iscinumpy.dev/post/slots-in-python/
Thu, 06 Aug 2015 16:01:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/slots-in-python/<p>Slots seem to be poorly documented. What they do is simple, but whether they are
used is tricky. This is a little mini-post on slots.</p>Basics of metaclasses
https://iscinumpy.dev/post/basics-of-metaclasses/
Thu, 06 Aug 2015 15:59:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/basics-of-metaclasses/<p>This is a quick tutorial over the basics of what metaclasses do.</p>
<h1 id="the-metaclass">The Metaclass</h1>
<p>Metaclasses, while seemingly a complex topic, really just do something very
simple. They control what happens when you have code that turns into a class
object. The normal place they are executed is right after the class statement.
Let’s see that in action by using print as our metaclass.</p>Factory classmethods in Python
https://iscinumpy.dev/post/factory-classmethods-in-python/
Wed, 29 Jul 2015 09:13:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/factory-classmethods-in-python/<p>I haven’t seen a great deal of practical documentation about using classmethods
as factories in Python (which is arguably the most important use of a
classmethod, IMO). This post hopes to fill in that gap.</p>Making an autoload extension for IPython
https://iscinumpy.dev/post/making-an-autoload-extension-for-ipython/
Fri, 24 Jul 2015 07:06:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/making-an-autoload-extension-for-ipython/<p>I recently decided to try my hand at making an auto-load extension for Python
and Plumbum. I was planning to suggest it as a new feature, then I thought it
might be an experimental feature, and now it’s just a blog post. But it was an
interesting idea and didn’t seem to be well documented process on the web. So,
here it is.</p>
<p>The plan was to make commands like this:</p>Uncertainty extension for IPython
https://iscinumpy.dev/post/uncertainty-extension-for-ipython/
Fri, 24 Jul 2015 06:45:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/uncertainty-extension-for-ipython/<p>Wouldn’t it be nice if we had uncertainty with a nice notation in IPython? The
current method would be to use raw Python,</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">uncertainties</span> <span class="kn">import</span> <span class="n">ufloat</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">ufloat</span><span class="p">(</span><span class="mf">12.34</span><span class="p">,</span> <span class="mf">0.01</span><span class="p">))</span>
</span></span></code></pre></div><pre style="output">
12.340+/-0.010
</pre>
<p>Let’s use the infix library to make the notation easier. We’ll define <code>|pm|</code> to
mean <code>+/-</code>.</p>Plumbum color
https://iscinumpy.dev/post/plumbum-color-post/
Wed, 22 Jul 2015 12:25:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/plumbum-color-post/<p>I’ve been working on a color addition to Plumbum for a little while, and I’d
like to share the basics of using it with you now. This library was originally
built around a special <code>str</code> subclass, but now is built on the new <code>Styles</code>
representation and is far more powerful than the first implementation. It safely
does nothing if you do not have a color-compatible systems (posix + tty
currently), but can be forced if need be. It is included with Plumbum, so you
don’t have to add a requirement for your scripts that is non-essential (as color
often is). It is integrated with <code>plumbum.cli</code>, too. Also, I’ve managed to
accelerate the color selection algorithms about 8x, allowing near game-like
speeds. (see the <code>fullcolor.py</code> example).</p>University of Texas Doctoral Thesis Template
https://iscinumpy.dev/post/univerity-of-texas-thesis/
Sun, 12 Jul 2015 17:05:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/univerity-of-texas-thesis/<p>I have created a thesis class file for a UT Thesis in LaTeX. It has already been
used for at least one passing thesis, so it does meet the current UT guidelines.
(Please let me know if there are any issues!)</p>
<p>Since I use Bitbucket for all my private repositories (like my thesis itself),
the code is in a Bitbucket repository rather than GitHub. Here is the link if
you want to create a pull request or want to compile the class and documentation
from the source .dtx file.</p>Plumbum scripting
https://iscinumpy.dev/post/plumbum-scripting/
Sun, 12 Jul 2015 14:07:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/plumbum-scripting/<p>Scripting in Bash is a pain. Bash can do almost anything, and is unbeatable for
small scripts, but it struggles when scaling up to doing anything close to a
real world scripting problem. Python is a natural choice, especially for the
scientist who already is using it for analysis. But, it’s much harder to do
basic tasks in Python. So you are left with scripts starting out as Bash
scripts, and then becoming a mess, then being (usually poorly) ported to Python,
or even worse, being run by a Python script. I’ve seen countless Python scripts
that run Bash scripts that run real programs. I’ve even written one or two. It’s
not pretty.</p>
<p>I recently came (back) across a really powerful library for doing efficient
command line scripts in Python. It contains a set of tools that makes the four
(five with color) main tasks of command line scripts simple and powerful. I will
also go over the one main drawback of the library (and the possible
enhancement!).</p>Simple Overloading in Python
https://iscinumpy.dev/post/simple-operator-overloading-in-python/
Tue, 07 Jul 2015 09:45:00 -0700[email protected] (Henry Schreiner)https://iscinumpy.dev/post/simple-operator-overloading-in-python/<p>This is intended as an example to demonstrate the use of overloading in object
oriented programming. This was written as a Jupyter notebook (aka IPython) in
Python 3. To run in Python 2, simply rename the variables that have unicode
names, and replace <code>truediv</code> with <code>div</code>.</p>
<p>While there are several nice Python libraries that support uncertainty (for
example, the powerful
<a href="https://pypi.python.org/pypi/uncertainties/">uncertainties</a> package and the
related units and uncertainties package
<a href="http://pint.readthedocs.org/en/0.6/">pint</a>), they usually use standard error
combination rules. For a beginning physics class, often ‘maximum error’
combination is used. Here, instead of using a standard deviation based error and
using combination rules based on uncorrelated statistical distributions, we
assume a simple maximum error and simply add errors.</p>
<p>To implement this, let’s build a Python class and use overloading to implement
algebraic operations.</p>Archives
https://iscinumpy.dev/page/archive/
Mon, 01 Jan 0001 00:00:00 +0000[email protected] (Henry Schreiner)https://iscinumpy.dev/page/archive/