First time here? Check out the FAQ!

Ask Your Question
1

Style guide for Sage

asked 5 years ago

dsejas gravatar image

Hello, Sage Community!

I was wondering, besides the usual PEP 8, which is Python-exclusive, is there any other style guide for Sage code? I imagine there should be such thing, since Sage has its own peculiar syntax for some tasks, which are not available for Python.

Thanks in advance!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 5 years ago

Emmanuel Charpentier gravatar image

Have a look at the Sage Developer's Guide, which should answer not only your current question but also some questions you're not yet aware to have...

Preview: (hide)
link

Comments

Hello, @emmanuel-charpentier! thank you very much. This is a helpful resource. However, I am needing something more daily-user-oriented, i.e., suggestions like "use srange instead of range if you need Sage Integers instead of Python ints", etc.

I need a guide for scientists who program on a daily basis, but they are not experts on programming. I am intending to translate that guide to Spanish for some of my colleagues who fit with this description, in order to popularize SageMath in my country (Bolivia). Otherwise, I could write such a guide by myself, but I don't want to "reinvent the wheel" in case there is one already.

dsejas gravatar imagedsejas ( 5 years ago )

In this case,; I can't too strongly recommend reading this book, english translation of an older french book.This is the closest equivalent to what you seek, along with a great tutorial.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 5 years ago )

Thank you, @emmanuel-charpentier! Yes, I stumbled with that book a year ago. I think it could use an update. I was hoping to find something more compact, like PEP8 is. However, according to my research, there isn't such thing.

Could I ask you a question? Is it possible for me to initiate something similar to the PEP system? Something like a "Sage Enhancement Proposal" (SEP) system. There could be a SEP that could be equivalent to PEP8 for SageMath. Should I start a new question about this? How can I get help with this?

Thanks for your help!

dsejas gravatar imagedsejas ( 5 years ago )

Hmmmm... you want to develop a new Sage documentation, it seems...

In this case, the proper thing to do would be to request an account on Trac, open a ticket and submit a patch.

However, it might be useful first to learn about Sage and its idiosyncrasies (it has a few...), as well the Sage development process (and its developers' idiiosyncrasies, which are also a few;_). And possibly wait a few month, since the Python 2 --> 3 process presently underway will probably change some historically-rooted habits.

ISTR that the Sage Developer's guide has also some useful guidelines for would-be contributors.

You may also join sage-devel to post your question there.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 5 years ago )

Thank you very much! I don't want to develop a new complete documentation, but a style guide. However, I can see your last comment, along with your answer, put me in the right track.

dsejas gravatar imagedsejas ( 5 years ago )

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

Stats

Asked: 5 years ago

Seen: 800 times

Last updated: Oct 22 '19