You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TIL this wasn't an intentional feature. I agree with the voiced consensus upon discussing it, which is that we should support a more explicit form of this trick.
However, if your code contains the variables above, it will actually still output them all if given only the prefix:
variables = my.variable, another.variable
That is, given name, parthenon outputs all variables which match name*.
While disgusting, this is actually also really convenient. By naming variables prims.rho, prims.u, etc I can ensure that regardless of which are enabled or the theory I'm evolving, all primitive variables will be output so long as I specify a list prims, etc, etc. However, it's definitely more bug than feature, and can be a problem if you have variables with suffixes (in my case, I discovered it by naming fields prims.B and prims.Bf for faces).
Thus it seems like we should replace the limited-match behavior with globbing. i.e., rather than treat prims == prims*, require the user to write prims* if they actually want to match all suffixes. Note some jerk may also expect support for prims.*.face or *.B* or other monstrosities (or god forbid regex) so we should decide where the madness stops, and implement/document a suitable compromise.
The text was updated successfully, but these errors were encountered:
I also wasn't aware of this "feature" and am in favor of keeping (but documenting/properly implementing it).
The constraint might be to disallow * in the variable names (which is probably a good idea anyway).
TIL this wasn't an intentional feature. I agree with the voiced consensus upon discussing it, which is that we should support a more explicit form of this trick.
When outputting variables, one specifies a list:
However, if your code contains the variables above, it will actually still output them all if given only the prefix:
That is, given
name
, parthenon outputs all variables which matchname*
.While disgusting, this is actually also really convenient. By naming variables
prims.rho, prims.u, etc
I can ensure that regardless of which are enabled or the theory I'm evolving, all primitive variables will be output so long as I specify a listprims, etc, etc
. However, it's definitely more bug than feature, and can be a problem if you have variables with suffixes (in my case, I discovered it by naming fieldsprims.B
andprims.Bf
for faces).Thus it seems like we should replace the limited-match behavior with globbing. i.e., rather than treat
prims
==prims*
, require the user to writeprims*
if they actually want to match all suffixes. Note some jerk may also expect support forprims.*.face
or*.B*
or other monstrosities (or god forbid regex) so we should decide where the madness stops, and implement/document a suitable compromise.The text was updated successfully, but these errors were encountered: