nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research

Home Page:https://nansencenter.github.io/DAPPER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figure numbers

patnr opened this issue · comments

For liveplotting, the figure numbers are assigned when defining the liveplots for the model. See lorenz63/__init__.py.

This is fine. Except there might be conflicting numbers. E.g. with the defaults defined at the bottom of liveplotting.py.

But requesting specific liveplotters via assimilate() then requires remembering these numbers. This is inelegant. It should be done by (fuzzy?) names instead.

I'd like to work on some existing issues but I think I need some clarifications.

I feel avoiding fignum conflict can be done in the Liveplot modules when it is defined from HMM.liveplotter.

But requesting specific liveplotters via assimilate() then requires remembering these numbers. This is inelegant. It should be done by (fuzzy?) names instead.

However, this point seems to imply that you want to remove the requirement of specifying fignum and assign the liveplots argument in assimilate() with the capability of (fuzzy) name match.

Do I understand it correctly?

Indeed, I should have been more verbose.

Keeping the same persistent figure numbers for the liveplotters has served two functions:

  • Being able to reference a subset of the available LPs (HMM.liveplotters) when running experiments, to only plot the selected ones.
  • Clearing the figures rather than creating new ones. This keeps figure position and size on screen, which I find to be very helpful. Note that in the most recent installs of DAPPER the freshfig function works quite well with pre-saved figure positions (on linux at least). This does not require specific figure numbers, but the positions are associated with a given fig number, so fig. number persistence is required.

Those two functions should be kept somehow.

Then there are the two issues:

  • Hardcoding figure numbers requires checking that there are no other liveplotters assigned to those numbers. This sucks.
  • Referencing specific liveplotters via figure numbers requires remembering their number. This sucks.

However, this point seems to imply that you want to remove the requirement of specifying fignum and assign the liveplots argument in assimilate() with the capability of (fuzzy) name match.

Yes, that's it.

  • I'm not sure if fuzzy is worth it, in these days of tab-completion.
  • Each item in the list HMM.liveplotters is a 3-dim tuple. The second entry therein is a boolean, specifying whether the liveplotter is enabled by default. This is also a little inelegant and could also be improved.

Closed by #63