Conversation
small change in README file
|
@NellyMitnik, looks good! |
|
Currently, the background script creates the images folder in the run folder ( |
alongd
left a comment
There was a problem hiding this comment.
Thanks! I added some comments
| "home = os.getenv(\"HOME\") or os.path.expanduser(\"~\")\n", | ||
| "rmg_pypath = os.path.join(home, 'anaconda3', 'envs', 'rmg_env', 'bin', 'python')\n", | ||
| "if not os.path.isfile(rmg_pypath):\n", | ||
| " raise Error('Could not find RMG-env')\n", |
There was a problem hiding this comment.
Python does not recognize Error, should be perhaps ValueError
| " raise Error('Could not find RMG-env')\n", | ||
| "\n", | ||
| "######### Edit the path below ##############\n", | ||
| "command = [rmg_pypath, '/home/nelly/OneDrive/Linux backup/scripts/Cantera/Flux diagram/background_script.py', species_dict_path]\n", |
There was a problem hiding this comment.
Please add this to the paths above to be modified by the user
| " \"\"\"\n", | ||
| " This func goes over the pdf images in images folder, and converts each pdf image to png image\n", | ||
| " \"\"\"\n", | ||
| " os.chdir(flux_diagram_folder_path+'/images')\n", |
There was a problem hiding this comment.
instead of flux_diagram_folder_path+'/images', can you do os.path.join(flux_diagram_folder_path, 'images)?
| for specie in species_dict.values(): | ||
| molecule=specie.molecule[0] | ||
| smiles=molecule.to_smiles() | ||
| if smiles != "[Ne]" and smiles != "[Ar]": #avoid parenthesis for elements - keep convention with Cantera |
There was a problem hiding this comment.
[He] will probably need a similar treatment if it's present in a model
There was a problem hiding this comment.
Consider:
for smiles in species_output_dict.values():
if smiles in ['[Ne]', '[He]', '[Ar]']:
convert_pdf_2_png(smiles[1:3], os.path.join(flux_diagram_folder_path, 'images', f'{smiles[1:3]}.pdf'))
else:
convert_pdf_2_png(smiles, os.path.join(flux_diagram_folder_path, 'images', f'{smiles}.pdf'))| " \"\"\"\n", | ||
| " This func creates a new folder to each t time interval. Inside that folder, 3 files are created:\n", | ||
| " dot, modified_dot, and png file (the flux diagram itself)\n", | ||
| " It's importatnt to note that the fluc diagram follows C element --> can be changed\n", |
| " element = 'C'\n", | ||
| "\n", | ||
| " if t==1:\n", | ||
| " t_path=flux_diagram_folder_path+\"/tau\"\n", |
There was a problem hiding this comment.
Could you use os.path.join() here as well, and anywhere else when combining paths?
|
Would you like to mention in the instructions that the users should have |
| """ | ||
| The main ARC executable function | ||
| """ | ||
| args = parse_command_line_arguments() |
There was a problem hiding this comment.
Looks like args is not being used
There was a problem hiding this comment.
This should be enough:
args = parse_command_line_arguments()
dict_species(args.file)
| for specie in species_dict.values(): | ||
| molecule=specie.molecule[0] | ||
| smiles=molecule.to_smiles() | ||
| if smiles != "[Ne]" and smiles != "[Ar]": #avoid parenthesis for elements - keep convention with Cantera |
There was a problem hiding this comment.
Consider:
for smiles in species_output_dict.values():
if smiles in ['[Ne]', '[He]', '[Ar]']:
convert_pdf_2_png(smiles[1:3], os.path.join(flux_diagram_folder_path, 'images', f'{smiles[1:3]}.pdf'))
else:
convert_pdf_2_png(smiles, os.path.join(flux_diagram_folder_path, 'images', f'{smiles}.pdf'))| """ | ||
| The main ARC executable function | ||
| """ | ||
| args = parse_command_line_arguments() |
There was a problem hiding this comment.
This should be enough:
args = parse_command_line_arguments()
dict_species(args.file)
No description provided.