for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import numpy as np
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
def cartesian(arrays):
return np.dstack(
np.meshgrid(*arrays, indexing='ij')
).reshape(-1, len(arrays))
def cartesian_(arrays, out=None):
"""
Generate a cartesian product of input arrays.
# A re-entrant function
dtype = arrays[0].dtype
n = np.prod([x.size for x in arrays])
n
(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
# This happen only the first iteration
if out is None:
out = np.zeros([n, len(arrays)], dtype=dtype)
m = n / arrays[0].size
m
out[:,0] = np.repeat(arrays[0], m)
if arrays[1:]:
cartesian_(arrays[1:], out=out[0:m, 1:])
for j in range(1, arrays[0].size):
out[j*m:(j+1)*m, 1:] = out[0:m, 1:]
return out
def ra_to_longitude(ra):
ra
if ra > 180.0:
longitude = -180 + (ra - 180.0)
else:
longitude = ra
return longitude
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.