Ask Your Question

What is the best way to create a library on top of Sage?

asked 2022-07-21 20:08:22 +0100

Pickle gravatar image

I am interested in using Sage to create a library for control theory (similar to SymPy and Python Control) below:

These libraries are great, but I want a library that has symbolic and numeric functionality. Therefore, I am considering using Sage to write the symbolic end and tie that with Python Control for the numeric end.

What is a good way to start creating this so that it can hopefully be integrated into the Sage build sometime in the future?

I came across someone with a similar idea before. They were using Sage to create a library for mechanics. The code is below. I notice that use a cas_utils.sage to hold their library. Then in notebooks like 061-Lagrange_bead_rotating_circle.ipynb, they load this library to use the features. Is this a good way to approach making a rough library based on Sage?

edit retag flag offensive close merge delete



There is a lot of information in the Sage Developer's Guide:

John Palmieri gravatar imageJohn Palmieri ( 2022-07-22 01:15:17 +0100 )edit

Hi John,

Thanks for the response. I have browsed a bit through the developers guide. One thing I struggle with is knowing where to start.

There is a lot of good stuff in that guide, but as a new developer I am not sure where to start. So any direction is appreciated to make some basic code.

Pickle gravatar imagePickle ( 2022-07-22 13:13:12 +0100 )edit

I think that you should just start writing code and using it. Writing a library for addition to Sage will likely take many iterations, so don't even try to get it right the first time: get something that works, then improve it, then think about it some more and see if it needs to be reorganized or optimized or modified in some other way, then work on it some more, etc. The more you and others use it, the more feedback you'll get. For example, proposed a new addition to the Sage library, but almost everything got rewritten between the original proposal and merging the new stuff. There were also probably lots of revisions before it even got to the stage of being an actual proposal.

John Palmieri gravatar imageJohn Palmieri ( 2022-07-23 20:28:51 +0100 )edit

I will do that! Thanks for the encouragement

Pickle gravatar imagePickle ( 2022-07-24 22:05:05 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-07-24 22:04:34 +0100

Pickle gravatar image

The comments from John are sufficient to answer this question

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-07-21 20:08:22 +0100

Seen: 277 times

Last updated: Jul 24 '22