Skip to content

Commit

Permalink
Fix bug when subsetting mesh specified in another directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MiCurry committed Jun 17, 2021
1 parent 0a62b2d commit 1a7cc81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion limited_area/limited_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ??
Expand Down

0 comments on commit 1a7cc81

Please sign in to comment.