[Python-ideas] Add a __cite__ method for scientific packages

David Mertz mertz at gnosis.cx
Sun Jul 1 09:43:53 EDT 2018


I think a __citation__ *method* is a bad idea. This yells out "attribute"
to me. A function or two that parses those attributes in some manner is a
better idea... And there's no reason that function or two need to be
dunders. There's also no reason they need to be in the standard library...
There might be many citation/writing applications that process the data to
their own needs.

But assuming there is an attribute, WHAT goes inside it? Is it a string?
And if so, in what markup format? Is it a dictionary? A list? A custom
class? Does some wrapper function deal with different formats. Does the
wrapper also scan for __author__, __copyright__, and friends?

We also need to decide what __citation__ is an attribute OF. Only modules?
Classes? Methods? Functions? All of the above? If multiple, how are the
attributes at different places synthesized or processed? Can one object
have multiple citations (e.g. what if a class or method implements multiple
algorithms depending on a switch... Or depending on the shape of the data
being processed? The different algorithms might need different citations).

These are all questions that could have good answers. But I don't know what
the answers are. I've worked in scientific computing for a good while, but
not as an academic. And when I was an academic it wasn't in scientific
computing. This list is not mostly composed of the relevant experts. Those
are the authors and users of SciPy and statsmodels, and scikit-learn, and
xarray, and Tensorflow, and astropy, and so on.

There's absolutely nothing in the idea that requires a change in Python,
and Python developers or users are not, as such, the relevant experts. In
the future, AFTER there is widespread acceptance of what goes on a
__citation__ attribute, it would be easy and obvious to add minimal support
in Python itself for displaying citation content. But this is the wrong
group to mandate what the actual academic needs are here.

On Sun, Jul 1, 2018, 9:07 AM Ivan Levkivskyi <levkivskyi at gmail.com> wrote:

> On 28 June 2018 at 01:19, Nathaniel Smith <njs at pobox.com> wrote:
>
>> On Wed, Jun 27, 2018 at 2:20 PM, Andrei Kucharavy
>> <andrei.kucharavy at gmail.com> wrote:
>> > To remediate to that situation, I suggest a __citation__ method
>> associated
>> > to each package installation and import. Called from the __main__,
>> > __citation__() would scan __citation__ of all imported packages and
>> return
>> > the list of all relevant top-level citations associated to the packages.
>>
>
> I actually think the opposite. If this is not fixed in a PEP it will stay
> in the current state.
> Writing a PEP (and officially accepting it) for this purpose will give a
> signal that it is a standard practice
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180701/3ddbb7b3/attachment-0001.html>


More information about the Python-ideas mailing list