epochs is a Python package to handle configuration files specifying values which change over time.

For example, consider a configuration file epochs.cfg containing the following:

[2019-04-09 20:27:15]
value : 3

[2019-04-09 22:31:01]
value : 5

Then value can be retrieved for various times:

>>> import epochs
>>> ep = epochs.parse('epochs.cfg')
>>> value = ep.get('value', datetime='2019-04-09 21:55:45')
>>> print(value)
3
>>> value = ep.get('value', datetime='2019-04-09 23:15:40')
>>> print(value)
5

If you provide a specification for the values in a configuration file, epochs can also validate a config file and provide values as the correct type and default value. For example, for a specification file containing:

[city]
name : required=True, type=str
streets : required=True, type=List[str]
temp : required=False, type=float, default=0.0

Then an example configuration file following this specification:

[city]
name : Boulder streets : [Broadway, Baseline, Valmont]

Then to parse the configuration file with a specification:

>>> import epochs
>>> cf = epochs.parse('example.cfg', spec='spec.cfg')
>>> name = cf.get('name', section='city')
>>> print(name)
Boulder
>>> streets = cf.get('streets', section='city')
>>> print(steets)
['Broadway', 'Baseline', 'Valmont']
>>> temp = cf.get('temp', section='city') 
>>> print(temp, type(temp))
0.0

epochs is in PyPI. It can be installed with pip:

pip install epochs

The epochs source code is available on GitHub.

I updated my groceries list app, Quantified Groceries, today. It's updated for recent phones and also now has a dark mode.

The release notes for 1.1.0:

  • [NEW] iPhone XS/XR screen size support
  • [NEW] Dark mode
  • [NEW] Haptic feedback (requires iPhone 7 or later)

IDL 8.7.1 adds the IDL Package Manager (IPM), a package manager for IDL libraries. You can install libraries from the Internet with a single command in IDL, even installing dependencies for the library if needed.

Continue reading "IDL Package Manager."

IDL 8.7.1 was released today. Check the What's New on the Docs Center for a comprehensive list of the new features.

Along with some performance improvements and library updates, there are two big new features:

  • an IDL package manager
  • machine learning classes (including a feed forward neural network class)

I will publish an article about the package manager shortly; I made IDLdoc, mgunit, and my personal library available through the package manager. I think this is now the best way to distribute IDL packages.

I am also excited to explore the machine learning classes. I will write more as soon we get 8.7.1 installed on our machines.

With these two new features, this is a powerful "bug fix" release.

When working with data files at my day job, I often come across directories containing a large number of files of several distinct types. It would be useful to produce a listing of the files clustered into these types. I wrote cls (Clustered ls) to find patterns in filenames for display.

Continue reading "Clustered ls."

Circular law states the eigenvalues of a matrix with random entries of mean 0 and variance 1/n are approximately uniformly distributed in the unit disk of the complex plane. To see this, create a random matrix:

n = 1000
x = randomu(seed, n, n) - 0.5
x *= sqrt(12.0 / n)

Find the eigenvalues:

eigenvalues = la_eigenproblem(x, eigenvectors=eigenvectors)

Plot them:

plot, real_part(eigenvalues), imaginary(eigenvalues), $
      psym=3, $
      xstyle=1, xrange=[-1.5, 1.5], $
      ystyle=1, yrange=[-1.5, 1.5]

This gives a plot like below:

Via the excellent John D. Cook blog. I recommend reading his site if you are interested in a combination of mathematics and Python.

IDLdoc 3.6.2 has been released! New features include:

  • Bug fix for image directive for image files in other directories specified with a relative path (fix by Dave Gellman).

  • Only copying MathJax for LaTeX-style equations if not already present.

  • Fixed crash when invalid format/markup was specified on the docformat line of a .pro file.

mgunit 1.6 has been released! New features include:

  • Fix for bug when no filename with jUnit output format

  • Recursively search directories below test suite home directory for *_ut.pro and *_uts.pro files

  • Fixed for bug in mguttestsuite_define::addTestingFolder that did not add absolute paths correctly

  • Add superclasses of test classes recursively

You can download a distribution with a .sav file and documentation, or just access the repo as needed.

This is fascinating:

People use imprecise words to describe the chance of events all the time — “It’s likely to rain,” or “There’s a real possibility they’ll launch before us,” or “It’s doubtful the nurses will strike.” Not only are such probabilistic terms subjective, but they also can have widely different interpretations. One person’s “pretty likely” is another’s “far from certain.” Our research shows just how broad these gaps in understanding can be and the types of problems that can flow from these differences in interpretation.

For example, below are probability distributions for some common phrases:

via FlowingData

I released a new version of my iOS app, Simple Checklist, today. Simple Checklist provides an easy way to track progress through checklists. I use them for my morning routine, weekly review, physical therapy, and other repeated sequences.

The release notes for 1.4.0:

  • [NEW] Dark mode
  • [NEW] iPhone X support
  • [NEW] Haptic feedback
  • [NEW] Markdown format for exported checklists
  • [FIX] Fixed order of exported checklist

Simple Checklist is available on the iOS App Store.

older posts »