From 893e566ae9a399755612ad50dff93f87e110b282 Mon Sep 17 00:00:00 2001 From: blancoapa Date: Thu, 29 Feb 2024 20:05:37 +0100 Subject: [PATCH] Move get_resource to preserve alphabetical order --- pyMBE.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pyMBE.py b/pyMBE.py index 8cafcd1..330ada3 100644 --- a/pyMBE.py +++ b/pyMBE.py @@ -1734,6 +1734,20 @@ def get_radius_map(self): return radius_map + def get_resource(self, path): + ''' + Locate a file resource of the pyMBE package. + + Args: + path(`str`): Relative path to the resource + + Returns: + path(`int`): Absolute path to the resource + + ''' + import os + return os.path.join(os.path.dirname(__file__), path) + def get_type_map(self): """ Gets all different espresso types assigned to particles in `pmb.df`. @@ -2750,16 +2764,4 @@ def write_output_vtf_file(self, espresso_system, filename): coordinates.write (f'{particle.id} \t {particle.pos[0]} \t {particle.pos[1]} \t {particle.pos[2]}\n') return - def get_resource(self, path): - ''' - Locate a file resource of the pyMBE package. - - Args: - path(`str`): Relative path to the resource - Returns: - path(`int`): Absolute path to the resource - - ''' - import os - return os.path.join(os.path.dirname(__file__), path)