MPAS-Dev / MPAS-Tools

MPAS Tools Repository
Other
39 stars 65 forks source link

Move `make_partition_files` to conda package and update to python 3 #417

Closed xylar closed 3 years ago

xylar commented 3 years ago

This merge updates the make_partition_files tool:

The metis package has been added as a dependency to the mpas_tools package

xylar commented 3 years ago

Sorry about the false alarm with #416. This is a PR to bring make_partition_files.py up to date.

@jonbob, I'll post the same questions I added on Confluence:

The old version of make_partition_files.py here would appear to me to be buggy (e.g. it imported numpy but used np in the code) and only worked for python2. So if you use this script, I am wondering whether you use the version from this repo or if you have your own copy or what the source is.

In general (whether old or new version), this script seems overly complicated for what we typically do. I distinguishes between blocks and processors, for example. So before this gets merged, I want to find out if this is the right point to consider a simpler tool for this purpose. The COMPASS function make_graph_file() would seem to be a simpler version of the same process.

jonbob commented 3 years ago

@xylar - I do use this script for generating graph files. I've never had any problem with it, other than it is occasionally slow. I think I have a version checked out from MPAS-Tools last June, and just point to a version of metis I had built.

xylar commented 3 years ago

@jonbob, does your version have the bug that it imports numpy but refers to np? If so, I'm wondering how it even works?

jonbob commented 3 years ago

It does have those handy features. I'm guessing it only works because I load an e3sm-unified conda environment when I use it?

xylar commented 3 years ago

@jonbob, I think I understand now. It has some (very naughty) from netCDF4 import * and from pylab import *. One of those must bring in numpy as np.

This script is a haught mess but if it works for now, fixing it doesn't have to be a high priority.

jonbob commented 3 years ago

It does work, so I'm happy to leave it to you to prioritize the haught messes!

xylar commented 3 years ago

I'm going to close this and just update the script to work with python 3 and not have any * imports. We can revisit other changes later.