Open Dioprz opened 1 month ago
I agree with that. The usage of this style was without much thought, as you correctly pointed out it was just inspired by what sage uses. Will this be automatically recognized or does this require some modifications of the setup / configuration files?
Great!
I'm not sure what do you mean by modifications on the setup/configuration files... Could you please expand a bit on that? (Maybe the change requires it and I don't know!)
Currently, our codebase uses a non-standard docstring style inspired by
sage docstrings
. While functional, this style presents several drawbacks, including poor support for automatic documentation generation tools like Sphinx and inconsistencies in formatting that includes:INPUT:
andOUTPUT:
need one colon, butEXAMPLES::
andTESTS::
require two... MATH::
,.. NOTE::
, require atypical leading dots.This issue proposes migrating to the industry-standard Google docstring style to address these shortcomings while capitalizing on the ongoing migration from
sage doctest
to Python's nativedoctest
.Current Style:
Proposed Style (Google Docstring):
Advantages of adopting this style include:
Args:
,Returns:
,Raises:
, and more, ensuring uniformity across the codebase.Importantly, this migration will not introduce significant overhead. The changes can be largely automated using carefully supervised AI prompts for semi-automated docstring generation.
Feedback required: @Javierverbel @Memphisd @FloydZ @fmerino21