hyriver / pynhd

A part of HyRiver software stack that provides access to NHD+ V2 data through NLDI and WaterData web services
https://docs.hyriver.io
Other
33 stars 8 forks source link

consistent naming convention in API #82

Open ecoon opened 11 hours ago

ecoon commented 11 hours ago

Is your feature request related to a problem?

It would be nice to have a consistent API naming convention across the various data access classes. Specifically:

https://github.com/hyriver/pynhd/blob/main/src/pynhd/pynhd.py#L727 --> WaterData.byid()

vs.

https://github.com/hyriver/pynhd/blob/main/src/pynhd/core.py#L224 --> AGRBase.byids() (e.g. NHD, NHDPlusHR, etc)

I'm fairly sure that the semantics are the same (e.g. both accept a list of IDs, not just a single ID).

Describe the solution you'd like

Change WaterData.byid() --> WaterData.byids() to match others.

Describe alternatives you've considered

No response

Additional context

I haven't seen any other instances of byid() in hyriver, but probably a quick grep would check to allow making them all consistent across the project. Nice work by the way!

cheginit commented 7 hours ago

I agree with this. I've been planning to work on this for a while now, but haven't really had the chance to work on it. It's not just this name, there are other instances like bygeom vs bygeometry. This has to be done in backward compatible way, so essentially just new names are just aliases for the previous functions. A PR is appreciated.