Skip to content

Commit

Permalink
fix finder.find_module and cm.register_cmap
Browse files Browse the repository at this point in the history
  • Loading branch information
akorosov committed Dec 16, 2024
1 parent ffdd9a7 commit 043d95a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion nansat/nansat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ def _import_mappers(log_level=None):
logger.debug('Loading mapper %s' % name)
# Only mappers containing 'mapper' in the module name should be returned
if not 'mapper' in name: continue
loader = finder.find_module(name)
loader = finder.find_spec(name).loader
# try to import mapper module
module = loader.load_module(name)
# add the imported mapper to nansat_mappers
Expand Down
6 changes: 0 additions & 6 deletions nansat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ def register_colormaps():
}
}

if MATPLOTLIB_IS_INSTALLED:
for name, colormap in colormaps.items():
if name not in matplotlib.colormaps:
cm.register_cmap(cmap=LinearSegmentedColormap(name, colormap, 256))


def initial_bearing(lon1, lat1, lon2, lat2):
"""Initial bearing when traversing from point1 (lon1, lat1)
to point2 (lon2, lat2)
Expand Down

0 comments on commit 043d95a

Please sign in to comment.