-
Notifications
You must be signed in to change notification settings - Fork 0
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
Python package #1
base: main
Are you sure you want to change the base?
Conversation
voa/copula.py
Outdated
@@ -26,23 +28,25 @@ def create_Q_grid(n=10): | |||
|
|||
return grid | |||
|
|||
|
|||
@numba.njit(parallel=True) | |||
def calculate_copula_part(t, c): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please type function signature, and use more verbose parameter names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the signatures. The names are kept according to the paper and the initial implementation. We can change it, but I think it will not make the code more readable as someone will need to "translate" the names from our code to the equations from original c# implementation.
voa/copula.py
Outdated
c[i, j] = c[0, j] + n_inv * np.sum(j >= t[:i]) | ||
return c | ||
|
||
|
||
@numba.njit | ||
def wn(n, c, i, j): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can maybe accept very short parameter names, but please name function verbosely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above applies here. The name wn come from the paper. We can change all the names, but the question is if we should. @mp360288 wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense then if it comes from paper. For readability imo you can do two things:
- add docstring
- differentiate between public and private API - I guess this
wn
function will never be called by user?
Hejka, zrobiłem (?) refactor kodu, tak, żeby zrobić z tego pakiet do pythona. Wszystkie pomysły i uwagi mile widziane.