-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ingredients #272
Ingredients #272
Conversation
ccomb
commented
Apr 20, 2023
•
edited
Loading
edited
- Brightway Explorer and Ingredient Editor in Jupyter notebooks
- Use the code instead of the name in complex ingredients
- Improved the dockerfile and makefile
- rewrote import and export
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.
I started reviewing the code until I realize this is WAY too much Python for me… so I focused on testing the ingredient form.
Got a FileNotFoundError
when I pressed the Publish
button:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/ipywidgets/widgets/widget_output.py:103, in Output.capture.<locals>.capture_decorator.<locals>.inner(*args, **kwargs)
101 self.clear_output(*clear_args, **clear_kwargs)
102 with self:
--> 103 return func(*args, **kwargs)
File ~/ecobalyse/data/notebooks/ingredients.py:347, in commit_ingredients(_)
344 @out.capture()
345 def commit_ingredients(_):
346 shutil.copy(INGREDIENTS_TEMP, INGREDIENTS_BASE)
--> 347 subprocess.run(f"git add {INGREDIENTS_BASE}")
348 subprocess.run("git commit -m 'new ingredients'")
349 subprocess.run("git push origin ingredients'")
File /opt/conda/lib/python3.10/subprocess.py:503, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
500 kwargs['stdout'] = PIPE
501 kwargs['stderr'] = PIPE
--> 503 with Popen(*popenargs, **kwargs) as process:
504 try:
505 stdout, stderr = process.communicate(input, timeout=timeout)
File /opt/conda/lib/python3.10/subprocess.py:971, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize)
967 if self.text_mode:
968 self.stderr = io.TextIOWrapper(self.stderr,
969 encoding=encoding, errors=errors)
--> 971 self._execute_child(args, executable, preexec_fn, close_fds,
972 pass_fds, cwd, env,
973 startupinfo, creationflags, shell,
974 p2cread, p2cwrite,
975 c2pread, c2pwrite,
976 errread, errwrite,
977 restore_signals,
978 gid, gids, uid, umask,
979 start_new_session)
980 except:
981 # Cleanup if the child failed starting.
982 for f in filter(None, (self.stdin, self.stdout, self.stderr)):
File /opt/conda/lib/python3.10/subprocess.py:1847, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session)
1845 if errno_num != 0:
1846 err_msg = os.strerror(errno_num)
-> 1847 raise child_exception_type(errno_num, err_msg, err_filename)
1848 raise child_exception_type(err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git add /home/jovyan/ecobalyse/data/food/export_agb/ingredients_base.json'
I tested again the documented setup adn the export commands, using the appropriate ZIP files, and it works just fine. Fort the records I'm having several minor differences in the impacts generated in Great work, for me this patch is — apart from remaining questions about the public availability of aforementioned ZIP files — in a landable state 👍 |