-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only use names and function signatures that are also valid in Python #47
Comments
Yes we can do that in the package. Note that these things are common in other R packages, so it may be difficult to avoid this in general in the Python layer when other packages are used. @lilyclements Could you help to make these changes? |
Happy to. Two questions:
|
I'll also add in |
I think just start with the Climsoft-like functions initially. If we have an |
Great have done for the climsoft-like functions in #49 In addition, is it okay for the resulting data frame to have variables that contain a R-Instat functions to edit: |
I think let's try to avoid that too, unless it's a requirement of the output in some way. |
Great, Ive done that in PR #49 |
Fixed in PR #49 |
The Python layer uses the 'rpy2' Python package. This package allows Python code to refer directly to R functions, parameters and other objects. In order to make the Python code simple and readable, we should minimise the transformations needed between the Python and R layers.
However, R allows some things that are illegal in Python. For example, the
climatic_summary()
function uses the following practices that are illegal in Python:na.rm
andsummaries.params
. To be consistent with Python, they should be namedna_rm
andsummaries_params
(or something similar).elements
andsummaries
parameters are in the middle of the list, they should be before the first parameter with a default value.The Python rpy2 package provides workarounds for the above but they add complexity and reduce readability.
Please would it be possible to avoid the above and only use names and function signatures that are also valid in Python?
Note: If I find new inconsistencies while I implement the Python layer, then I will add extra check boxes to the list above.
The text was updated successfully, but these errors were encountered: