ncmaps icon indicating copy to clipboard operation
ncmaps copied to clipboard

Should ncmaps invest in apt-get packaging?

Open TomLav opened this issue 4 years ago • 14 comments

Many scientists working on Linux will install ncview using a package manager, e.g. apt-get install ncview

Should ncmaps also be made available as a package in Linux distros ?

Maybe ppl can install ncview directly with ncmaps in the future, like apt-get install ncview-with-ncmaps ?

I have no idea what it requires to prepare a python module such as ours for linux distributions.

TomLav avatar Nov 25 '21 21:11 TomLav

and I am going to ping @samhatfield here to start the discussion :-)

TomLav avatar Nov 25 '21 22:11 TomLav

Interesting idea. Which distros should we be thinking of? Perhaps we could start with Ubuntu and go from there? For that I think a PPA would be best. Though ncmaps doesn't have a build process, a ncview-with-ncmaps package would so that might slightly complicate things.

I don't actually have access to an Ubuntu machine, but I can try installing a virtual machine and playing around with PPAs.

samhatfield avatar Nov 26 '21 09:11 samhatfield

Yes, I was thinking of Ubuntu because this is what I am using today (but we might be moving to a Red Hat in the future).

Of course, the other option is to fork and patch the ncview software itself (it is somewhere on github), and build a Linux module from that. But I am not sure I want to take responsibility / control for this "beast".

TomLav avatar Nov 26 '21 09:11 TomLav

I have actually compiled ncview from scratch before and it was surprisingly easy. I will start by making an ncview fork and trying to integrate our colour maps. If that's easy then that might be a better approach for a PPA. (I might make this a Christmas project...)

samhatfield avatar Nov 29 '21 10:11 samhatfield

Cool. Then ncmaps could be tweaked to also prepare a .h file for the compilation of ncview, if this is the easiest.

TomLav avatar Nov 29 '21 10:11 TomLav

Yes, although given that we'll (presumably) only have to do this once it might not be worth the effort. I'll have a look and see how the existing built in colour maps are read.

samhatfield avatar Nov 29 '21 11:11 samhatfield

Hi Sam, any more thoughts on that ? I was just now installing ncview on a new laptop and thought that it would be grand if it directly came with our colormaps :-)

TomLav avatar Jun 01 '22 10:06 TomLav

Hey Tom - I have just been swamped with work this year (albeit interesting work 😀), but I have just had a go at adding support for Batlow:

https://github.com/samhatfield/ncview-ncmaps

Could you build that and see how it works, with all of the ncmaps stuff turned off? You should see Batlow as the second option.

In this fork, we could just delete all of the legacy ncview colormaps. Will anyone want to use them once the scientific ones are available?

samhatfield avatar Jun 06 '22 13:06 samhatfield

Hei Sam, I am sure you have your hands full with (interesting) stuff!

Building your ncview worked fine on my Ubuntu (still running 18.04 bionic here), and batlow was indeed available as choice number 2.

image

For the record, here is how I installed:

sudo apt-get install libudunits2-dev libnetcdf-dev libx11-dev libxaw7-dev libexpat1-dev libpng-dev CC=/usr/bin/cc ./configure make (then run src/ncview)

Concerning the legacy colormaps, I would opt for shipping them anyway, but have them deactivated as default. I have colleagues who use ncmaps, but still re-activated one of two of the legacy colormaps because they like the results (no comment).

TomLav avatar Jun 08 '22 21:06 TomLav

On this note, if we go for a fork of ncview, I would suggest that this package (ncmaps) is further developed (and possibly merged into the forked ncview codebase) so that it prepares the .h files needed for building ncview.

TomLav avatar Jun 09 '22 20:06 TomLav

Sure. At the moment I have a little script that converts .ncmap files to .h. Next I'll try to bring them all in. The current way of including colourmaps in ncview is quite cumbersome though, with lots of duplicated code. I wonder if there's a better way of doing it.

samhatfield avatar Jun 09 '22 21:06 samhatfield

I'll see if I can make ncmaps to write the .h files you need. This could possibly be included in a larger script that would prepare more of the duplicated code you refer to, that could run first in the make process?

TomLav avatar Jun 10 '22 07:06 TomLav

My latest commit makes it quite a bit simpler. Now all we have to do is generate the .h files, put them in the colormaps directory and then automatically generate this file.

Before we think about automation, could you have a go at adding the rest of the colormaps and generating that file? I've added you as a collaborator :)

samhatfield avatar Jun 14 '22 15:06 samhatfield

I placed a bunch of .h files in the colormaps directory of ncview-ncmaps (all pushed onto the repo). The .h files are generated from ncmaps. But it seems to have broken the ncview-ncmaps, not even the (new) batlow works.

I'll open a new issue on ncview-ncmaps for better traceability.

TomLav avatar Jun 14 '22 19:06 TomLav