spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

Rename keyword arguments for consistency #318

Closed manuelma closed 8 months ago

manuelma commented 10 months ago

We use class_name for entity and entity_group, and entity_class_name for everything else. We should make it consistent. I am not sure if I prefer entity_class_name over class_name. class_name can be nice too.

We also use byname for entity, and entity_byname for everything else. We could use entity_byname even for entity.

jkiviluo commented 10 months ago

I'd prefer entity_byname also when its entity PublicItem. Since byname is used only with entities, it's bit more difficult to remember to switch to byname when the PublicItem is entity (compared to name, where it's more natural to call any PublicItem by 'name' only).

jkiviluo commented 10 months ago

Regarding entity_class_name, I think we should go with the long form, since that's what it is called elsewhere in the code and in the UI. The shorter form could be ok, if we would then also switch to that everywhere else as well (although in GUI we should probably keep using entity class).

jkiviluo commented 10 months ago

I was browsing through the code and realised class_name is used there much more than entity_class_name. So, ok also to switch to class_name. We don't have any other classes than entity classes in the foreseeable future. Maybe in the UI it's good to keep using entity class name to make things as clear as possible.

soininen commented 8 months ago

Forgot to update the tutorial.