-
Notifications
You must be signed in to change notification settings - Fork 1
Flux diagram #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Flux diagram #10
Conversation
calvinp0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[He] will probably need a similar treatment if it's present in a model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: flux
| " element = 'C'\n", | ||
| "\n", | ||
| " if t==1:\n", | ||
| " t_path=flux_diagram_folder_path+\"/tau\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like args is not being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be enough:
args = parse_command_line_arguments()
dict_species(args.file)
alongd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two comments
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be enough:
args = parse_command_line_arguments()
dict_species(args.file)
No description provided.