zxcalc / quantomatic

Quantomatic is a tool for doing automated graph rewriting.
http://quantomatic.github.io
151 stars 22 forks source link

project default rewrites #230

Open rossduncan opened 6 years ago

rossduncan commented 6 years ago

It would be nice if you could specify a default set of rules to loaded whenever a new derivation is started without having to specify them every time

hmillerbakewell commented 6 years ago

It's a good idea. The only misgiving I have is that I think it would be best stored at the project level (same as what theory you're using,) because it's project dependent. Projects are set up to be immutable, so while it's possible and makes sense to change this (and possible to set this up keeping projects immutable) I would appreciate input on what else we would like stored at the project level, and whether anyone sees any pitfalls.

Thoughts, @akissinger ?

Currently we store: Name, Theory

The "name" part is barely referenced in the code, and doesn't seem to work anyway. The "theory" part is important to keep safe, and is currently only altered by the Alter Theory panel.

akissinger commented 6 years ago

The only problem I could foresee with sticking this in the project is if you wish to share a quanto project with someone else. The "current ruleset" is essentially throwaway info, so it shouldn't necessarily be part of the thing you share. Worse, it could create needless conflicts if multiple people are working on a project in source control at the same time.

What we could do is store this list globally, and just check that the stored rules are indeed there before trying to add them (this is a good idea anyway). The way I work, I find I'm not switching projects very often, so this would get the job done for me.

rossduncan commented 6 years ago

Aleks's suggestion would be fine for me.