Skip to content

Script KeyError with colormaps - not registered without importing analysator plot.py #406

@alhom

Description

@alhom

plot "submodule" is now lazily imported when importing analysator. This means that it will not register new colormaps, and if a user has a script that does

import analysator as pt
import maplotlib.pyplot as plt

# do something

plt.pcolor(somedata, cmap="glasgow")
# glasgow being an example of a SCM8 colormap 
# registered by analysator.plot and not in Matplotlib (3.10, at least)

... matplotlib will not find "glasgow" colormap anymore.

Solution:

import analysator as pt
import maplotlib.pyplot as plt
import plot # this imports analysator plotting module and registers the colormaps 

Solution is subject to change after #354.

This issue is information-only, since the whole shebang of poking at other modules when importing yours is kind of iffy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions