openPMD-api icon indicating copy to clipboard operation
openPMD-api copied to clipboard

Unfortunate convention `io`

Open chillenzer opened this issue 2 years ago • 4 comments

What do you want to achieve, please describe.

In PIConGPU, I've stumbled across the fact that your documentation suggests to use

import openpmd_api as io

which coincidentally is also the name of a standard library module in the Python language.

This is an unfortunate ambiguity. We are in the process of coming up with a different convention for PIConGPU ourselves but if you feel the same about this, we would be inclined to wait for the openPMD community to come up with a less ambiguous convention to adopt. Any thoughts?

chillenzer avatar Feb 05 '24 10:02 chillenzer

Ouch, I thought I was smart when introducing this short-hand :D Yes, colliding with a std module name is not ideal.

Agreed, great idea to come up with a new documented/uniform short-hand. I am not a big fan of pmd as abbreviation, because there is only openPMD. I also do not want people to abbreviate openPMD as PMD, to keep the name recognition clear.

Ideas welcome! :)

import openpmd_api as pmd  # hm

or

import openpmd_api as oio  # lol

or

import openpmd_api as api  # too generic

or

import openpmd_api as opmd  # okish?

or

import openpmd_api as data

or ...?

ax3l avatar Feb 06 '24 22:02 ax3l

The pythonic idiom

Explicit is better than implicit.

could be interpreted as not actually needing a shorthand at all. Given that I'm currently sitting in front of a 4K monitor with an IDE doing autocompletion, I could totally spare the additional 7-8 characters.

That said,

import openpmd_api as opmd  # okish?

was what came to my mind, too.

chillenzer avatar Feb 07 '24 11:02 chillenzer

@ax3l, there's a push in PIConGPU to start implementing this. We'd go with opmd unless there is a consensus here soon.

chillenzer avatar Apr 23 '24 07:04 chillenzer

I think that opmd is the most obvious solution and you can go forward with it

franzpoeschel avatar Apr 23 '24 07:04 franzpoeschel