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

More convenient API function for removing items #203

Closed DillonJ closed 10 months ago

DillonJ commented 1 year ago

It seems like we could do with more convenient methods for removing items. Right now, revote_items() and friends we need a list of object ids which aren't very convenient to obtain when working with a dataset in Pyton.

There may be issues I haven't considered, but for an API, removing items should be at the same level of convenience as adding and updating - it's a fundamental operation.

Edit: and maybe a companion function would be to get an entity ID from an entity name which could be a list if non-unique

manuelma commented 1 year ago

I completely agree, we need a full name-based add/update/remove API. At the moment the closest we have is the import_data which is a combination of add and update, not very predictable and of course it doesn't cover removal.

soininen commented 1 year ago

I agree as well. We should have a full-blown name-based add/update/remove API.

jkiviluo commented 1 year ago

@manuelma Is this now done in v0.8?

manuelma commented 1 year ago

Needs polishing but it's on the works.

jkiviluo commented 10 months ago

I think we're there on this issue.