Open michaellisitsa opened 3 years ago
Hi @michaellisitsa
Yes, I am finding that this "parentheses feature" has a tendency to create some unexpected behaviour. I am re-evaluating whether it is a good idea or not. Thank you for your code sample. I will give it a try. I am going to start implementing some fixes and features into handcalcs shortly. I really want to get this "parentheses feature" behaviour locked down.
In my experience with it, there have been times where it has been convenient for me but I find I am using it less and less, in favour of using param
cells more. Would like to hear your thoughts on it. Do you find yourself using the feature often?
Thanks for your continued feedback and support!
Hi Connor, I have used the brackets very often, especially when I want to mix params only and substitutions in one Jupyter cell. It is also very handy when I just do something like 100 * u.MPa
where the back-substitution is quite pointless, so I just want to silence that line.
I think some sort of method to silence the back-substitution on a line by line basis is still handy, even if it doesn't involve brackets, but of course separating into separate Jupyter cells is always possible.
@michaellisitsa Yeah, I agree. It is useful and quite handy. I am working on an update to make export templates compatible with Jupyter Lab v3.0 which I am quite excited about (custom exporter, will be able to "Export HTML with Handcalcs" from the File -> Export as... menu in Jupyter Lab).
I will add the parentheses fix to the list, also!
Usually placing brackets around the equation will hide any substitution. However, when there are internal brackets, the substitution is still shown.
How to reproduce
Expected Result
Potential Solution Could we parse the brackets to see which one matches with which. Then if the outside pair enclose the whole line (minus quotes), we can remove substitution steps. Something like this link which I've copied below:
Result:
Then loop through
d
to see whether any match{0:len(expression)}