Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I have two separate folders for different projects with some notebook (.cnb) files. In both folders I use the names methods.cnb, latex_macros.cnb, properties.cnb to split up the code, then import them into a main file to do work.

I noticed that, when importing from a .cnb, cadabra will convert it to a .py file and store it in the /home/user/cadabra_packages folder (on Ubuntu).

At the moment, I need to manually delete these cached files in cadabra_packages before I can swap between my projects.

I was wondering if there are any suggestions on how to make this better? I am very amateurish, but would appreciate a pointer in the right direction so that I can manage my files better. The only thing I would like is for it to be operating system agnostic, so I can also do it on mac.

Some ideas I thought of:

(1) Directly use .py files in the project folders so no .cnbs need to be cached.

(2) Rename the files e.g. methods1.cnb in the first folder, methods2.cnb in the second.

I am not keen on (2) because it would be nice to have the same layout in folders for different projects. I could compromise with (1), but I do enjoy editing the files using the notebook interface.

Thanks!

ago in General questions by (170 points)

1 Answer

0 votes

The version of Cadabra in the devel branch on github contains code which avoids multiple identically-named notebooks mapping to the same converted .py file. You can build this from source or wait a little until this gets released as 2.5.12.

ago by (84.7k points)
...