Loading src/galassify/utils.py +19 −20 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ def exist_basic_files(): if not path.exists(file): test_files = False if not path.exists('files/galaxies.csv'): if not path.exists('files/galaxies_fits.csv'): test_files = False return test_files Loading Loading @@ -114,34 +113,34 @@ def init_flag(): pass def example_flag(type_example): if type_example == 'basic': try: print(f"INFO:\t Generating the necessary files...") try: # Copy common files os.system(f"cp '{getPackageResource('config')}' config") os.system("mkdir -p files img") # Copy and create example-specific files if type_example == 'basic': os.system(f"cp '{getPackageResource('files/galaxies.csv')}' files/galaxies.csv") content = glob.glob(f"{getPackageResource('img/')}") content = [f for f in os.listdir(f"{getPackageResource('img/')}") if re.match(r'.*\.jpeg', f)] for element in content: elemet_dir = getPackageResource('img/'+element) os.system(f"cp '{elemet_dir}' img/{element}") print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies.csv -s files/output.csv -p img/ ") except: pass else: try: print(f"INFO:\t Generating the necessary files...") os.system(f"cp '{getPackageResource('config')}' config") os.system("mkdir -p files img/fits") os.system(f"cp '{getPackageResource('files/galaxies_fits.csv')}' files/galaxies_fits.csv") os.system(f"cp '{getPackageResource('files/galaxies_fits.csv')}' files/galaxies.csv") os.system("mkdir -p img/fits") content=glob.glob(f"{getPackageResource('img/fits/')}") content = [f for f in os.listdir(f"{getPackageResource('img/fits/')}") if re.match(r'.*\.fits', f)] for element in content: elemet_dir = getPackageResource('img/fits/'+element) os.system(f"cp '{elemet_dir}' img/fits/{element}") print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies_fits.csv -s files/output.csv -p img/ ") except: pass print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies.csv -s files/output.csv -p img/ ") print(f"INFO:\t If needed, you can download catalogue images by executing: get_images_sdss -i files/galaxies.csv -p img/ ") except Exception as e: print(f"ERROR: Error while creating the necessary files: {e}") def getVersion(): global VERSION Loading Loading
src/galassify/utils.py +19 −20 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ def exist_basic_files(): if not path.exists(file): test_files = False if not path.exists('files/galaxies.csv'): if not path.exists('files/galaxies_fits.csv'): test_files = False return test_files Loading Loading @@ -114,34 +113,34 @@ def init_flag(): pass def example_flag(type_example): if type_example == 'basic': try: print(f"INFO:\t Generating the necessary files...") try: # Copy common files os.system(f"cp '{getPackageResource('config')}' config") os.system("mkdir -p files img") # Copy and create example-specific files if type_example == 'basic': os.system(f"cp '{getPackageResource('files/galaxies.csv')}' files/galaxies.csv") content = glob.glob(f"{getPackageResource('img/')}") content = [f for f in os.listdir(f"{getPackageResource('img/')}") if re.match(r'.*\.jpeg', f)] for element in content: elemet_dir = getPackageResource('img/'+element) os.system(f"cp '{elemet_dir}' img/{element}") print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies.csv -s files/output.csv -p img/ ") except: pass else: try: print(f"INFO:\t Generating the necessary files...") os.system(f"cp '{getPackageResource('config')}' config") os.system("mkdir -p files img/fits") os.system(f"cp '{getPackageResource('files/galaxies_fits.csv')}' files/galaxies_fits.csv") os.system(f"cp '{getPackageResource('files/galaxies_fits.csv')}' files/galaxies.csv") os.system("mkdir -p img/fits") content=glob.glob(f"{getPackageResource('img/fits/')}") content = [f for f in os.listdir(f"{getPackageResource('img/fits/')}") if re.match(r'.*\.fits', f)] for element in content: elemet_dir = getPackageResource('img/fits/'+element) os.system(f"cp '{elemet_dir}' img/fits/{element}") print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies_fits.csv -s files/output.csv -p img/ ") except: pass print(f"INFO:\t The necessary files were created. \nINFO:\t Now, open GALAssify with: galassify -i files/galaxies.csv -s files/output.csv -p img/ ") print(f"INFO:\t If needed, you can download catalogue images by executing: get_images_sdss -i files/galaxies.csv -p img/ ") except Exception as e: print(f"ERROR: Error while creating the necessary files: {e}") def getVersion(): global VERSION Loading