-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Some suggestions #101
base: main
Are you sure you want to change the base?
Some suggestions #101
Conversation
{ |
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.
It is easier to read through if it is formatted properly in JSON form.
import os | ||
|
||
import numpy as np | ||
from numpy import sin, cos, tan, pi, sqrt | ||
from numpy.core.defchararray import index | ||
import yaml | ||
import os | ||
|
||
from collections import OrderedDict | ||
# import imp | ||
from numpy import sin, cos, tan, pi, sqrt | ||
|
||
# import welleng.error |
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.
- Sorted the imports
- Removed
from numpy.core.defchararray import index
since it wasn't used in the file.
mag_defaults={ | ||
'b_total': 50_000., | ||
'dip': 70., | ||
'declination': 0., | ||
}, | ||
mag_defaults=None, |
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.
Initialization of function arguments to mutable objects is not recommended in python. Check "Using mutable objects as default argument values in python" of this page.
@@ -444,8 +448,10 @@ def _get_azi_mag_and_true_deg(self): | |||
def _get_radius(self, radius=None): | |||
if radius is None: | |||
self.radius = np.full_like(self.md.astype(float), 0.3048) | |||
|
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.
It is advisable to put an extra line after the if clause.
While going over the code I edited some part of the code and thought it would be useful to share it with you.
I'm adding comments throughout the code to explain reasons for the suggestions.