From 1a7cc81edf38fb858bc91b2ff89b583699305769 Mon Sep 17 00:00:00 2001 From: "Miles A. Curry" Date: Thu, 17 Jun 2021 11:11:50 -0600 Subject: [PATCH] Fix bug when subsetting mesh specified in another directory Before, MPAS-Limited-Area would use the whole path name of the file specified to create the subseted mesh, which would cause an error in its file creation. This change uses os.path.basename which uses the Unix/Linux basename, which returns the name after the last '/'. Note: basename may not work if specifying other OS paths (e.g. Windows) on Linux. --- limited_area/limited_area.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/limited_area/limited_area.py b/limited_area/limited_area.py index 6f4f28d..e376cf3 100644 --- a/limited_area/limited_area.py +++ b/limited_area/limited_area.py @@ -213,7 +213,7 @@ def create_partiton_fname(self, name, mesh, **kwargs): def create_regional_fname(self, regionName, meshFileName, **kwargs): """ Create the regional file name by prepending the regional name (specified by Name: ) in the points file, to the meshFileName. """ - return regionName+'.'+meshFileName + return regionName+'.'+os.path.basename(meshFileName) # Mark_neighbors_search - Faster for smaller regions ??