kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

import plain text cdb files #180

Open leo-brewin opened 4 years ago

leo-brewin commented 4 years ago

Hi Kasper,

Thanks for extending Cadabra to allow imports from .cdb files. I've done a bit of fiddling and I have a query.

I can see that when foo.cdb is imported Cadabra caches a compiled version of foo in cadabra_pacakges. The problem is that a single cache can't store compiled versions for two or more different files all named foo.cdb. That wouldn't be a problem if all copies of foo.cdb were identical but that is not always the case. Python deals with this problem by localising the cache (--pycache--) to the directory in which the imported file lives. Could a similar idea be used here? Maybe --cdbcahce--? 

Cheers, Leo

kpeeters commented 4 years ago

Yeah, I knew this was coming someday... Let me see what I can do.