uptake / groundhog

Service and client libraries for interacting with SRTM elevation data
BSD 3-Clause "New" or "Revised" License
7 stars 8 forks source link

Use doppel-cli to keep the Python and R clients' interfaces identical #13

Open jameslamb opened 5 years ago

jameslamb commented 5 years ago

See docs in https://github.com/jameslamb/doppel-cli for examples. Basically I think it would be valuable for the R and Python clients to have identical interfaces.

jayqi commented 5 years ago

I ran doppel-cli on groundhog and the out put is below:

Function Count
==============
+----------------------+-----------------+
|   groundhog [python] |   groundhog [r] |
+======================+=================+
|                    1 |               1 |
+----------------------+-----------------+

Function Names
==============
+-----------------------+----------------------+-----------------+
| function_name         | groundhog [python]   | groundhog [r]   |
+=======================+======================+=================+
| append_slope_features | yes                  | no              |
+-----------------------+----------------------+-----------------+
| AppendSlopeFeatures   | no                   | yes             |
+-----------------------+----------------------+-----------------+

Function Argument Names
=======================
No shared functions.

Class Count
===========
+----------------------+-----------------+
|   groundhog [python] |   groundhog [r] |
+======================+=================+
|                    1 |               0 |
+----------------------+-----------------+

Class Names
===========
+-----------------+----------------------+-----------------+
| class_name      | groundhog [python]   | groundhog [r]   |
+=================+======================+=================+
| GroundhogClient | yes                  | no              |
+-----------------+----------------------+-----------------+

Class Public Methods
====================
No shared classes.

Arguments in Class Public Methods
=================================
No shared classes.

Test Failures (4)
===================
1. Function 'append_slope_features()' is not exported by all packages

2. Function 'AppendSlopeFeatures()' is not exported by all packages

3. Packages have different counts of exported classes! groundhog [python] (1), groundhog [r] (0)

4. Class 'GroundhogClient' is not exported by all packages
jayqi commented 5 years ago

Not sure about the best way to reproduce GroundhogClient in the R package. Implementing with R6 would be the simplest way, but that adds a dependency.

We could try potentially doing it with References Classes.

(I know doppel-cli does not currently support checking reference classes per description in this issue https://github.com/jameslamb/doppel-cli/issues/2 )

jameslamb commented 5 years ago

I think the R6 dependency for an R client is ok. Alternatively, we could treat the class as an internal detail and bring the APIs in line by internalizing GroundhogClient on the Python side.