repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
loop_actions
def loop_actions(results, times, N_matrix, ifprint): """ Finds actions, angles and frequencies for loop orbit. Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) -- explained in find_actions() below. results must be ...
python
def loop_actions(results, times, N_matrix, ifprint): """ Finds actions, angles and frequencies for loop orbit. Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) -- explained in find_actions() below. results must be ...
Finds actions, angles and frequencies for loop orbit. Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) -- explained in find_actions() below. results must be oriented such that circulation is about the z-axis
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L138-L183
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
angmom
def angmom(x): """ returns angular momentum vector of phase-space point x""" return np.array([x[1]*x[5]-x[2]*x[4],x[2]*x[3]-x[0]*x[5],x[0]*x[4]-x[1]*x[3]])
python
def angmom(x): """ returns angular momentum vector of phase-space point x""" return np.array([x[1]*x[5]-x[2]*x[4],x[2]*x[3]-x[0]*x[5],x[0]*x[4]-x[1]*x[3]])
returns angular momentum vector of phase-space point x
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L186-L188
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
assess_angmom
def assess_angmom(X): """ Checks for change of sign in each component of the angular momentum. Returns an array with ith entry 1 if no sign change in i component and 0 if sign change. Box = (0,0,0) S.A loop = (0,0,1) L.A loop = (1,0,0) """ L=angmom(X[0]) l...
python
def assess_angmom(X): """ Checks for change of sign in each component of the angular momentum. Returns an array with ith entry 1 if no sign change in i component and 0 if sign change. Box = (0,0,0) S.A loop = (0,0,1) L.A loop = (1,0,0) """ L=angmom(X[0]) l...
Checks for change of sign in each component of the angular momentum. Returns an array with ith entry 1 if no sign change in i component and 0 if sign change. Box = (0,0,0) S.A loop = (0,0,1) L.A loop = (1,0,0)
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L191-L210
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
flip_coords
def flip_coords(X,loop): """ Align circulation with z-axis """ if(loop[0]==1): return np.array(map(lambda i: np.array([i[2],i[1],i[0],i[5],i[4],i[3]]),X)) else: return X
python
def flip_coords(X,loop): """ Align circulation with z-axis """ if(loop[0]==1): return np.array(map(lambda i: np.array([i[2],i[1],i[0],i[5],i[4],i[3]]),X)) else: return X
Align circulation with z-axis
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L213-L218
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
find_actions
def find_actions(results, t, N_matrix=8, use_box=False, ifloop=False, ifprint = True): """ Main routine: Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) where act is the actions, ang the initial angles and frequen...
python
def find_actions(results, t, N_matrix=8, use_box=False, ifloop=False, ifprint = True): """ Main routine: Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) where act is the actions, ang the initial angles and frequen...
Main routine: Takes a series of phase-space points from an orbit integration at times t and returns L = (act,ang,n_vec,toy_aa, pars) where act is the actions, ang the initial angles and frequencies, n_vec the n vectors of the Fourier modes, toy_aa the toy action-angle coords, and pars ar...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L221-L259
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
plot_Sn_timesamples
def plot_Sn_timesamples(PSP): """ Plots Fig. 5 from Sanders & Binney (2014) """ TT = pot.stackel_triax() f,a = plt.subplots(2,1,figsize=[3.32,3.6]) plt.subplots_adjust(hspace=0.,top=0.8) LowestPeriod = 2.*np.pi/38.86564386 Times = np.array([2.,4.,8.,12.]) Sr = np.arange(2,14,2) # Loop ...
python
def plot_Sn_timesamples(PSP): """ Plots Fig. 5 from Sanders & Binney (2014) """ TT = pot.stackel_triax() f,a = plt.subplots(2,1,figsize=[3.32,3.6]) plt.subplots_adjust(hspace=0.,top=0.8) LowestPeriod = 2.*np.pi/38.86564386 Times = np.array([2.,4.,8.,12.]) Sr = np.arange(2,14,2) # Loop ...
Plots Fig. 5 from Sanders & Binney (2014)
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L266-L311
adrn/gala
gala/dynamics/_genfunc/genfunc_3d.py
plot3D_stacktriax
def plot3D_stacktriax(initial,final_t,N_MAT,file_output): """ For producing plots from paper """ # Setup Stackel potential TT = pot.stackel_triax() times = choose_NT(N_MAT) timeseries=np.linspace(0.,final_t,times) # Integrate orbit results = odeint(pot.orbit_derivs2,initial,timeseries,args=...
python
def plot3D_stacktriax(initial,final_t,N_MAT,file_output): """ For producing plots from paper """ # Setup Stackel potential TT = pot.stackel_triax() times = choose_NT(N_MAT) timeseries=np.linspace(0.,final_t,times) # Integrate orbit results = odeint(pot.orbit_derivs2,initial,timeseries,args=...
For producing plots from paper
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/genfunc_3d.py#L314-L386
adrn/gala
gala/coordinates/poincarepolar.py
cartesian_to_poincare_polar
def cartesian_to_poincare_polar(w): r""" Convert an array of 6D Cartesian positions to Poincaré symplectic polar coordinates. These are similar to cylindrical coordinates. Parameters ---------- w : array_like Input array of 6D Cartesian phase-space positions. Should have sha...
python
def cartesian_to_poincare_polar(w): r""" Convert an array of 6D Cartesian positions to Poincaré symplectic polar coordinates. These are similar to cylindrical coordinates. Parameters ---------- w : array_like Input array of 6D Cartesian phase-space positions. Should have sha...
r""" Convert an array of 6D Cartesian positions to Poincaré symplectic polar coordinates. These are similar to cylindrical coordinates. Parameters ---------- w : array_like Input array of 6D Cartesian phase-space positions. Should have shape ``(norbits,6)``. Returns ---...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/coordinates/poincarepolar.py#L6-L42
adrn/gala
gala/dynamics/analyticactionangle.py
isochrone_to_aa
def isochrone_to_aa(w, potential): """ Transform the input cartesian position and velocity to action-angle coordinates in the Isochrone potential. See Section 3.5.2 in Binney & Tremaine (2008), and be aware of the errata entry for Eq. 3.225. This transformation is analytic and can be used as a ...
python
def isochrone_to_aa(w, potential): """ Transform the input cartesian position and velocity to action-angle coordinates in the Isochrone potential. See Section 3.5.2 in Binney & Tremaine (2008), and be aware of the errata entry for Eq. 3.225. This transformation is analytic and can be used as a ...
Transform the input cartesian position and velocity to action-angle coordinates in the Isochrone potential. See Section 3.5.2 in Binney & Tremaine (2008), and be aware of the errata entry for Eq. 3.225. This transformation is analytic and can be used as a "toy potential" in the Sanders & Binney (20...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/analyticactionangle.py#L19-L154
adrn/gala
gala/dynamics/analyticactionangle.py
harmonic_oscillator_to_aa
def harmonic_oscillator_to_aa(w, potential): """ Transform the input cartesian position and velocity to action-angle coordinates for the Harmonic Oscillator potential. This transformation is analytic and can be used as a "toy potential" in the Sanders & Binney (2014) formalism for computing action-...
python
def harmonic_oscillator_to_aa(w, potential): """ Transform the input cartesian position and velocity to action-angle coordinates for the Harmonic Oscillator potential. This transformation is analytic and can be used as a "toy potential" in the Sanders & Binney (2014) formalism for computing action-...
Transform the input cartesian position and velocity to action-angle coordinates for the Harmonic Oscillator potential. This transformation is analytic and can be used as a "toy potential" in the Sanders & Binney (2014) formalism for computing action-angle coordinates in any potential. .. note:: ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/analyticactionangle.py#L299-L352
adrn/gala
gala/integrate/pyintegrators/rk5.py
RK5Integrator.step
def step(self, t, w, dt): """ Step forward the vector w by the given timestep. Parameters ---------- dt : numeric The timestep to move forward. """ # Runge-Kutta Fehlberg formulas (see: Numerical Recipes) F = lambda t, w: self.F(t, w,...
python
def step(self, t, w, dt): """ Step forward the vector w by the given timestep. Parameters ---------- dt : numeric The timestep to move forward. """ # Runge-Kutta Fehlberg formulas (see: Numerical Recipes) F = lambda t, w: self.F(t, w,...
Step forward the vector w by the given timestep. Parameters ---------- dt : numeric The timestep to move forward.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/integrate/pyintegrators/rk5.py#L52-L77
adrn/gala
gala/dynamics/_genfunc/solver.py
check_each_direction
def check_each_direction(n,angs,ifprint=True): """ returns a list of the index of elements of n which do not have adequate toy angle coverage. The criterion is that we must have at least one sample in each Nyquist box when we project the toy angles along the vector n """ checks = np.array([]) P = np...
python
def check_each_direction(n,angs,ifprint=True): """ returns a list of the index of elements of n which do not have adequate toy angle coverage. The criterion is that we must have at least one sample in each Nyquist box when we project the toy angles along the vector n """ checks = np.array([]) P = np...
returns a list of the index of elements of n which do not have adequate toy angle coverage. The criterion is that we must have at least one sample in each Nyquist box when we project the toy angles along the vector n
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/solver.py#L10-L33
adrn/gala
gala/dynamics/_genfunc/solver.py
solver
def solver(AA, N_max, symNx = 2, throw_out_modes=False): """ Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (J_0,J_1,J_2,S...) where x contains all Fourier components of the generating function with |n|<N_max """ # Find all integer compone...
python
def solver(AA, N_max, symNx = 2, throw_out_modes=False): """ Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (J_0,J_1,J_2,S...) where x contains all Fourier components of the generating function with |n|<N_max """ # Find all integer compone...
Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (J_0,J_1,J_2,S...) where x contains all Fourier components of the generating function with |n|<N_max
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/solver.py#L35-L78
adrn/gala
gala/dynamics/_genfunc/solver.py
unroll_angles
def unroll_angles(A,sign): """ Unrolls the angles, A, so they increase continuously """ n = np.array([0,0,0]) P = np.zeros(np.shape(A)) P[0]=A[0] for i in range(1,len(A)): n = n+((A[i]-A[i-1]+0.5*sign*np.pi)*sign<0)*np.ones(3)*2.*np.pi P[i] = A[i]+sign*n return P
python
def unroll_angles(A,sign): """ Unrolls the angles, A, so they increase continuously """ n = np.array([0,0,0]) P = np.zeros(np.shape(A)) P[0]=A[0] for i in range(1,len(A)): n = n+((A[i]-A[i-1]+0.5*sign*np.pi)*sign<0)*np.ones(3)*2.*np.pi P[i] = A[i]+sign*n return P
Unrolls the angles, A, so they increase continuously
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/solver.py#L81-L89
adrn/gala
gala/dynamics/_genfunc/solver.py
angle_solver
def angle_solver(AA, timeseries, N_max, sign, symNx = 2, throw_out_modes=False): """ Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (theta_0,theta_1,theta_2,omega_1, omega_2,omega_3, dSdx..., dSdy..., dSdz...) where x contains all derivatives ...
python
def angle_solver(AA, timeseries, N_max, sign, symNx = 2, throw_out_modes=False): """ Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (theta_0,theta_1,theta_2,omega_1, omega_2,omega_3, dSdx..., dSdy..., dSdz...) where x contains all derivatives ...
Constructs the matrix A and the vector b from a timeseries of toy action-angles AA to solve for the vector x = (theta_0,theta_1,theta_2,omega_1, omega_2,omega_3, dSdx..., dSdy..., dSdz...) where x contains all derivatives of the Fourier components of the generating function with |n| < N_max
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/_genfunc/solver.py#L94-L151
adrn/gala
gala/potential/scf/core.py
compute_coeffs
def compute_coeffs(density_func, nmax, lmax, M, r_s, args=(), skip_odd=False, skip_even=False, skip_m=False, S_only=False, progress=False, **nquad_opts): """ Compute the expansion coefficients for representing the input density function using a basis function expansion....
python
def compute_coeffs(density_func, nmax, lmax, M, r_s, args=(), skip_odd=False, skip_even=False, skip_m=False, S_only=False, progress=False, **nquad_opts): """ Compute the expansion coefficients for representing the input density function using a basis function expansion....
Compute the expansion coefficients for representing the input density function using a basis function expansion. Computing the coefficients involves computing triple integrals which are computationally expensive. For an example of how to parallelize the computation of the coefficients, see ``examples/p...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/potential/scf/core.py#L13-L129
adrn/gala
gala/potential/scf/core.py
compute_coeffs_discrete
def compute_coeffs_discrete(xyz, mass, nmax, lmax, r_s, skip_odd=False, skip_even=False, skip_m=False, compute_var=False): """ Compute the expansion coefficients for representing the density distribution of input points as a basis function expansion. T...
python
def compute_coeffs_discrete(xyz, mass, nmax, lmax, r_s, skip_odd=False, skip_even=False, skip_m=False, compute_var=False): """ Compute the expansion coefficients for representing the density distribution of input points as a basis function expansion. T...
Compute the expansion coefficients for representing the density distribution of input points as a basis function expansion. The points, ``xyz``, are assumed to be samples from the density distribution. Computing the coefficients involves computing triple integrals which are computationally expensive. F...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/potential/scf/core.py#L132-L216
adrn/gala
gala/dynamics/nbody/core.py
DirectNBody.integrate_orbit
def integrate_orbit(self, **time_spec): """ Integrate the initial conditions in the combined external potential plus N-body forces. This integration uses the `~gala.integrate.DOPRI853Integrator`. Parameters ---------- **time_spec Specification of how...
python
def integrate_orbit(self, **time_spec): """ Integrate the initial conditions in the combined external potential plus N-body forces. This integration uses the `~gala.integrate.DOPRI853Integrator`. Parameters ---------- **time_spec Specification of how...
Integrate the initial conditions in the combined external potential plus N-body forces. This integration uses the `~gala.integrate.DOPRI853Integrator`. Parameters ---------- **time_spec Specification of how long to integrate. See documentation for `~gala...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/nbody/core.py#L115-L153
adrn/gala
gala/dynamics/mockstream/core.py
mock_stream
def mock_stream(hamiltonian, prog_orbit, prog_mass, k_mean, k_disp, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified potential with a ...
python
def mock_stream(hamiltonian, prog_orbit, prog_mass, k_mean, k_disp, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified potential with a ...
Generate a mock stellar stream in the specified potential with a progenitor system that ends up at the specified position. Parameters ---------- hamiltonian : `~gala.potential.Hamiltonian` The system Hamiltonian. prog_orbit : `~gala.dynamics.Orbit` The orbit of the progenitor system...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/mockstream/core.py#L19-L164
adrn/gala
gala/dynamics/mockstream/core.py
streakline_stream
def streakline_stream(hamiltonian, prog_orbit, prog_mass, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified potential with a progenitor ...
python
def streakline_stream(hamiltonian, prog_orbit, prog_mass, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified potential with a progenitor ...
Generate a mock stellar stream in the specified potential with a progenitor system that ends up at the specified position. This uses the Streakline method from Kuepper et al. (2012). Parameters ---------- hamiltonian : `~gala.potential.Hamiltonian` The system Hamiltonian. prog_orbit : ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/mockstream/core.py#L167-L234
adrn/gala
gala/dynamics/mockstream/core.py
dissolved_fardal_stream
def dissolved_fardal_stream(hamiltonian, prog_orbit, prog_mass, t_disrupt, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified pot...
python
def dissolved_fardal_stream(hamiltonian, prog_orbit, prog_mass, t_disrupt, release_every=1, Integrator=DOPRI853Integrator, Integrator_kwargs=dict(), snapshot_filename=None, output_every=1, seed=None): """ Generate a mock stellar stream in the specified pot...
Generate a mock stellar stream in the specified potential with a progenitor system that ends up at the specified position. This uses the prescription from Fardal et al. (2015), but at a specified time the progenitor completely dissolves and the radial offset of the tidal radius is reduced to 0 at fixed...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/mockstream/core.py#L307-L388
adrn/gala
gala/coordinates/velocity_frame_transforms.py
vgsr_to_vhel
def vgsr_to_vhel(coordinate, vgsr, vsun=None): """ Convert a radial velocity in the Galactic standard of rest (GSR) to a barycentric radial velocity. Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passe...
python
def vgsr_to_vhel(coordinate, vgsr, vsun=None): """ Convert a radial velocity in the Galactic standard of rest (GSR) to a barycentric radial velocity. Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passe...
Convert a radial velocity in the Galactic standard of rest (GSR) to a barycentric radial velocity. Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passed to the SkyCoord initializer. vgsr : :class:`~...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/coordinates/velocity_frame_transforms.py#L18-L45
adrn/gala
gala/coordinates/velocity_frame_transforms.py
vhel_to_vgsr
def vhel_to_vgsr(coordinate, vhel, vsun): """ Convert a velocity from a heliocentric radial velocity to the Galactic standard of rest (GSR). Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passed ...
python
def vhel_to_vgsr(coordinate, vhel, vsun): """ Convert a velocity from a heliocentric radial velocity to the Galactic standard of rest (GSR). Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passed ...
Convert a velocity from a heliocentric radial velocity to the Galactic standard of rest (GSR). Parameters ---------- coordinate : :class:`~astropy.coordinates.SkyCoord` An Astropy SkyCoord object or anything object that can be passed to the SkyCoord initializer. vhel : :class:`~astr...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/coordinates/velocity_frame_transforms.py#L48-L75
adrn/gala
gala/dynamics/representation_nd.py
NDMixin._apply
def _apply(self, method, *args, **kwargs): """Create a new representation with ``method`` applied to the arrays. In typical usage, the method is any of the shape-changing methods for `~numpy.ndarray` (``reshape``, ``swapaxes``, etc.), as well as those picking particular elements (``__ge...
python
def _apply(self, method, *args, **kwargs): """Create a new representation with ``method`` applied to the arrays. In typical usage, the method is any of the shape-changing methods for `~numpy.ndarray` (``reshape``, ``swapaxes``, etc.), as well as those picking particular elements (``__ge...
Create a new representation with ``method`` applied to the arrays. In typical usage, the method is any of the shape-changing methods for `~numpy.ndarray` (``reshape``, ``swapaxes``, etc.), as well as those picking particular elements (``__getitem__``, ``take``, etc.), which are all defi...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/representation_nd.py#L14-L43
adrn/gala
gala/dynamics/representation_nd.py
NDCartesianRepresentation.get_xyz
def get_xyz(self, xyz_axis=0): """Return a vector array of the x, y, and z coordinates. Parameters ---------- xyz_axis : int, optional The axis in the final array along which the x, y, z components should be stored (default: 0). Returns ------- ...
python
def get_xyz(self, xyz_axis=0): """Return a vector array of the x, y, and z coordinates. Parameters ---------- xyz_axis : int, optional The axis in the final array along which the x, y, z components should be stored (default: 0). Returns ------- ...
Return a vector array of the x, y, and z coordinates. Parameters ---------- xyz_axis : int, optional The axis in the final array along which the x, y, z components should be stored (default: 0). Returns ------- xs : `~astropy.units.Quantity` ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/representation_nd.py#L100-L132
adrn/gala
gala/potential/common.py
CommonBase._get_c_valid_arr
def _get_c_valid_arr(self, x): """ Warning! Interpretation of axes is different for C code. """ orig_shape = x.shape x = np.ascontiguousarray(x.reshape(orig_shape[0], -1).T) return orig_shape, x
python
def _get_c_valid_arr(self, x): """ Warning! Interpretation of axes is different for C code. """ orig_shape = x.shape x = np.ascontiguousarray(x.reshape(orig_shape[0], -1).T) return orig_shape, x
Warning! Interpretation of axes is different for C code.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/potential/common.py#L60-L66
adrn/gala
gala/potential/common.py
CommonBase._validate_prepare_time
def _validate_prepare_time(self, t, pos_c): """ Make sure that t is a 1D array and compatible with the C position array. """ if hasattr(t, 'unit'): t = t.decompose(self.units).value if not isiterable(t): t = np.atleast_1d(t) t = np.ascontiguousar...
python
def _validate_prepare_time(self, t, pos_c): """ Make sure that t is a 1D array and compatible with the C position array. """ if hasattr(t, 'unit'): t = t.decompose(self.units).value if not isiterable(t): t = np.atleast_1d(t) t = np.ascontiguousar...
Make sure that t is a 1D array and compatible with the C position array.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/potential/common.py#L68-L85
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.get_components
def get_components(self, which): """ Get the component name dictionary for the desired object. The returned dictionary maps component names on this class to component names on the desired object. Parameters ---------- which : str Can either be ``'pos...
python
def get_components(self, which): """ Get the component name dictionary for the desired object. The returned dictionary maps component names on this class to component names on the desired object. Parameters ---------- which : str Can either be ``'pos...
Get the component name dictionary for the desired object. The returned dictionary maps component names on this class to component names on the desired object. Parameters ---------- which : str Can either be ``'pos'`` or ``'vel'`` to get the components for the ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L196-L226
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.represent_as
def represent_as(self, new_pos, new_vel=None): """ Represent the position and velocity of the orbit in an alternate coordinate system. Supports any of the Astropy coordinates representation classes. Parameters ---------- new_pos : :class:`~astropy.coordinates.Bas...
python
def represent_as(self, new_pos, new_vel=None): """ Represent the position and velocity of the orbit in an alternate coordinate system. Supports any of the Astropy coordinates representation classes. Parameters ---------- new_pos : :class:`~astropy.coordinates.Bas...
Represent the position and velocity of the orbit in an alternate coordinate system. Supports any of the Astropy coordinates representation classes. Parameters ---------- new_pos : :class:`~astropy.coordinates.BaseRepresentation` The type of representation to generate...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L300-L346
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.to_frame
def to_frame(self, frame, current_frame=None, **kwargs): """ Transform to a new reference frame. Parameters ---------- frame : `~gala.potential.FrameBase` The frame to transform to. current_frame : `gala.potential.CFrameBase` The current frame the...
python
def to_frame(self, frame, current_frame=None, **kwargs): """ Transform to a new reference frame. Parameters ---------- frame : `~gala.potential.FrameBase` The frame to transform to. current_frame : `gala.potential.CFrameBase` The current frame the...
Transform to a new reference frame. Parameters ---------- frame : `~gala.potential.FrameBase` The frame to transform to. current_frame : `gala.potential.CFrameBase` The current frame the phase-space position is in. **kwargs Any additional argu...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L348-L402
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.to_coord_frame
def to_coord_frame(self, frame, galactocentric_frame=None, **kwargs): """ Transform the orbit from Galactocentric, cartesian coordinates to Heliocentric coordinates in the specified Astropy coordinate frame. Parameters ---------- frame : :class:`~astropy.coordinates.Base...
python
def to_coord_frame(self, frame, galactocentric_frame=None, **kwargs): """ Transform the orbit from Galactocentric, cartesian coordinates to Heliocentric coordinates in the specified Astropy coordinate frame. Parameters ---------- frame : :class:`~astropy.coordinates.Base...
Transform the orbit from Galactocentric, cartesian coordinates to Heliocentric coordinates in the specified Astropy coordinate frame. Parameters ---------- frame : :class:`~astropy.coordinates.BaseCoordinateFrame` The class or frame instance specifying the desired output fra...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L404-L455
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.w
def w(self, units=None): """ This returns a single array containing the phase-space positions. Parameters ---------- units : `~gala.units.UnitSystem` (optional) The unit system to represent the position and velocity in before combining into the full array...
python
def w(self, units=None): """ This returns a single array containing the phase-space positions. Parameters ---------- units : `~gala.units.UnitSystem` (optional) The unit system to represent the position and velocity in before combining into the full array...
This returns a single array containing the phase-space positions. Parameters ---------- units : `~gala.units.UnitSystem` (optional) The unit system to represent the position and velocity in before combining into the full array. Returns ------- w ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L458-L500
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.to_hdf5
def to_hdf5(self, f): """ Serialize this object to an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file. """ if isinstance(f, str): import h5py f ...
python
def to_hdf5(self, f): """ Serialize this object to an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file. """ if isinstance(f, str): import h5py f ...
Serialize this object to an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L543-L576
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.from_hdf5
def from_hdf5(cls, f): """ Load an object from an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file. """ if isinstance(f, str): import h5py f = h5p...
python
def from_hdf5(cls, f): """ Load an object from an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file. """ if isinstance(f, str): import h5py f = h5p...
Load an object from an HDF5 file. Requires ``h5py``. Parameters ---------- f : str, :class:`h5py.File` Either the filename or an open HDF5 file.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L579-L619
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.energy
def energy(self, hamiltonian): r""" The total energy *per unit mass* (e.g., kinetic + potential): Parameters ---------- hamiltonian : `gala.potential.Hamiltonian` The Hamiltonian object to evaluate the energy. Returns ------- E : :class:`~ast...
python
def energy(self, hamiltonian): r""" The total energy *per unit mass* (e.g., kinetic + potential): Parameters ---------- hamiltonian : `gala.potential.Hamiltonian` The Hamiltonian object to evaluate the energy. Returns ------- E : :class:`~ast...
r""" The total energy *per unit mass* (e.g., kinetic + potential): Parameters ---------- hamiltonian : `gala.potential.Hamiltonian` The Hamiltonian object to evaluate the energy. Returns ------- E : :class:`~astropy.units.Quantity` The to...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L660-L687
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.angular_momentum
def angular_momentum(self): r""" Compute the angular momentum for the phase-space positions contained in this object:: .. math:: \boldsymbol{{L}} = \boldsymbol{{q}} \times \boldsymbol{{p}} See :ref:`shape-conventions` for more information about the shapes of ...
python
def angular_momentum(self): r""" Compute the angular momentum for the phase-space positions contained in this object:: .. math:: \boldsymbol{{L}} = \boldsymbol{{q}} \times \boldsymbol{{p}} See :ref:`shape-conventions` for more information about the shapes of ...
r""" Compute the angular momentum for the phase-space positions contained in this object:: .. math:: \boldsymbol{{L}} = \boldsymbol{{q}} \times \boldsymbol{{p}} See :ref:`shape-conventions` for more information about the shapes of input and output objects. ...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L689-L718
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition._plot_prepare
def _plot_prepare(self, components, units): """ Prepare the ``PhaseSpacePosition`` or subclass for passing to a plotting routine to plot all projections of the object. """ # components to plot if components is None: components = self.pos.components n_...
python
def _plot_prepare(self, components, units): """ Prepare the ``PhaseSpacePosition`` or subclass for passing to a plotting routine to plot all projections of the object. """ # components to plot if components is None: components = self.pos.components n_...
Prepare the ``PhaseSpacePosition`` or subclass for passing to a plotting routine to plot all projections of the object.
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L723-L776
adrn/gala
gala/dynamics/core.py
PhaseSpacePosition.plot
def plot(self, components=None, units=None, auto_aspect=True, **kwargs): """ Plot the positions in all projections. This is a wrapper around `~gala.dynamics.plot_projections` for fast access and quick visualization. All extra keyword arguments are passed to that function (the doc...
python
def plot(self, components=None, units=None, auto_aspect=True, **kwargs): """ Plot the positions in all projections. This is a wrapper around `~gala.dynamics.plot_projections` for fast access and quick visualization. All extra keyword arguments are passed to that function (the doc...
Plot the positions in all projections. This is a wrapper around `~gala.dynamics.plot_projections` for fast access and quick visualization. All extra keyword arguments are passed to that function (the docstring for this function is included here for convenience). Parameters -----...
https://github.com/adrn/gala/blob/ea95575a0df1581bb4b0986aebd6eea8438ab7eb/gala/dynamics/core.py#L778-L852
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_account
def create_account(self, email_address, password=None, client_id=None, client_secret=None): ''' Create a new account. If the account is created via an app, then Account.oauth will contain the OAuth data that can be used to execute actions on behalf of the newly created account. Args: ...
python
def create_account(self, email_address, password=None, client_id=None, client_secret=None): ''' Create a new account. If the account is created via an app, then Account.oauth will contain the OAuth data that can be used to execute actions on behalf of the newly created account. Args: ...
Create a new account. If the account is created via an app, then Account.oauth will contain the OAuth data that can be used to execute actions on behalf of the newly created account. Args: email_address (str): Email address of the new account to create passw...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L173-L206
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_account_info
def get_account_info(self): ''' Get current account information The information then will be saved in `self.account` so that you can access the information like this: >>> hsclient = HSClient() >>> acct = hsclient.get_account_info() >>> print acct.email_address ...
python
def get_account_info(self): ''' Get current account information The information then will be saved in `self.account` so that you can access the information like this: >>> hsclient = HSClient() >>> acct = hsclient.get_account_info() >>> print acct.email_address ...
Get current account information The information then will be saved in `self.account` so that you can access the information like this: >>> hsclient = HSClient() >>> acct = hsclient.get_account_info() >>> print acct.email_address Returns: An Account object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L210-L227
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.update_account_info
def update_account_info(self): ''' Update current account information At the moment you can only update your callback_url. Returns: An Account object ''' request = self._get_request() return request.post(self.ACCOUNT_UPDATE_URL, { 'callback_url'...
python
def update_account_info(self): ''' Update current account information At the moment you can only update your callback_url. Returns: An Account object ''' request = self._get_request() return request.post(self.ACCOUNT_UPDATE_URL, { 'callback_url'...
Update current account information At the moment you can only update your callback_url. Returns: An Account object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L231-L243
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.verify_account
def verify_account(self, email_address): ''' Verify whether a HelloSign Account exists Args: email_address (str): Email address for the account to verify Returns: True or False ''' request = self._get_request() resp = request.pos...
python
def verify_account(self, email_address): ''' Verify whether a HelloSign Account exists Args: email_address (str): Email address for the account to verify Returns: True or False ''' request = self._get_request() resp = request.pos...
Verify whether a HelloSign Account exists Args: email_address (str): Email address for the account to verify Returns: True or False
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L245-L259
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_signature_request
def get_signature_request(self, signature_request_id, ux_version=None): ''' Get a signature request by its ID Args: signature_request_id (str): The id of the SignatureRequest to retrieve ux_version (int): UX version, either 1 (default) or 2. Returns:...
python
def get_signature_request(self, signature_request_id, ux_version=None): ''' Get a signature request by its ID Args: signature_request_id (str): The id of the SignatureRequest to retrieve ux_version (int): UX version, either 1 (default) or 2. Returns:...
Get a signature request by its ID Args: signature_request_id (str): The id of the SignatureRequest to retrieve ux_version (int): UX version, either 1 (default) or 2. Returns: A SignatureRequest object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L264-L286
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_signature_request_list
def get_signature_request_list(self, page=1, ux_version=None): ''' Get a list of SignatureRequest that you can access This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Args: page (int, optional): Which page number...
python
def get_signature_request_list(self, page=1, ux_version=None): ''' Get a list of SignatureRequest that you can access This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Args: page (int, optional): Which page number...
Get a list of SignatureRequest that you can access This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Args: page (int, optional): Which page number of the SignatureRequest list to return. Defaults to 1. ux_ver...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L289-L314
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_signature_request_file
def get_signature_request_file(self, signature_request_id, path_or_file=None, file_type=None, filename=None): ''' Download the PDF copy of the current documents Args: signature_request_id (str): Id of the signature request path_or_file (str or file): A writable File-like objec...
python
def get_signature_request_file(self, signature_request_id, path_or_file=None, file_type=None, filename=None): ''' Download the PDF copy of the current documents Args: signature_request_id (str): Id of the signature request path_or_file (str or file): A writable File-like objec...
Download the PDF copy of the current documents Args: signature_request_id (str): Id of the signature request path_or_file (str or file): A writable File-like object or a full path to save the PDF file to. filename (str): [DEPRECATED] Filename to save the PDF f...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L316-L337
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.send_signature_request
def send_signature_request(self, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None, allow_decline=False): ...
python
def send_signature_request(self, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None, allow_decline=False): ...
Creates and sends a new SignatureRequest with the submitted documents Creates and sends a new SignatureRequest with the submitted documents. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifyi...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L339-L417
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.send_signature_request_with_template
def send_signature_request_with_template(self, test_mode=False, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None, allow_decline=False): ''' Creates and sends a new SignatureRequest b...
python
def send_signature_request_with_template(self, test_mode=False, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None, allow_decline=False): ''' Creates and sends a new SignatureRequest b...
Creates and sends a new SignatureRequest based off of a Template Creates and sends a new SignatureRequest based off of the Template specified with the template_id parameter. Args: test_mode (bool, optional): Whether this is a test, the signature request will not be leg...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L419-L492
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.remind_signature_request
def remind_signature_request(self, signature_request_id, email_address): ''' Sends an email to the signer reminding them to sign the signature request Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hours of the last reminder ...
python
def remind_signature_request(self, signature_request_id, email_address): ''' Sends an email to the signer reminding them to sign the signature request Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hours of the last reminder ...
Sends an email to the signer reminding them to sign the signature request Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hours of the last reminder that was sent. This includes manual AND automatic reminders. Args: ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L495-L515
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.cancel_signature_request
def cancel_signature_request(self, signature_request_id): ''' Cancels a SignatureRequest Cancels a SignatureRequest. After canceling, no one will be able to sign or access the SignatureRequest or its documents. Only the requester can cancel and only before everyone has signed. ...
python
def cancel_signature_request(self, signature_request_id): ''' Cancels a SignatureRequest Cancels a SignatureRequest. After canceling, no one will be able to sign or access the SignatureRequest or its documents. Only the requester can cancel and only before everyone has signed. ...
Cancels a SignatureRequest Cancels a SignatureRequest. After canceling, no one will be able to sign or access the SignatureRequest or its documents. Only the requester can cancel and only before everyone has signed. Args: signing_request_id (str): The id of the signature r...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L517-L533
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_template
def get_template(self, template_id): ''' Gets a Template which includes a list of Accounts that can access it Args: template_id (str): The id of the template to retrieve Returns: A Template object ''' request = self._get_request() return reques...
python
def get_template(self, template_id): ''' Gets a Template which includes a list of Accounts that can access it Args: template_id (str): The id of the template to retrieve Returns: A Template object ''' request = self._get_request() return reques...
Gets a Template which includes a list of Accounts that can access it Args: template_id (str): The id of the template to retrieve Returns: A Template object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L705-L717
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_template_list
def get_template_list(self, page=1, page_size=None, account_id=None, query=None): ''' Lists your Templates Args: page (int, optional): Page number of the template List to return. Defaults to 1. page_size (int, optional): Number of objects to be returned per page,...
python
def get_template_list(self, page=1, page_size=None, account_id=None, query=None): ''' Lists your Templates Args: page (int, optional): Page number of the template List to return. Defaults to 1. page_size (int, optional): Number of objects to be returned per page,...
Lists your Templates Args: page (int, optional): Page number of the template List to return. Defaults to 1. page_size (int, optional): Number of objects to be returned per page, must be between 1 and 100, default is 20. account_id (str, optional): Which a...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L720-L741
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.add_user_to_template
def add_user_to_template(self, template_id, account_id=None, email_address=None): ''' Gives the specified Account access to the specified Template Args: template_id (str): The id of the template to give the account access to account_id (str): The id of the account t...
python
def add_user_to_template(self, template_id, account_id=None, email_address=None): ''' Gives the specified Account access to the specified Template Args: template_id (str): The id of the template to give the account access to account_id (str): The id of the account t...
Gives the specified Account access to the specified Template Args: template_id (str): The id of the template to give the account access to account_id (str): The id of the account to give access to the template. The account id prevails if both account_id and email_address ar...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L744-L759
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.remove_user_from_template
def remove_user_from_template(self, template_id, account_id=None, email_address=None): ''' Removes the specified Account's access to the specified Template Args: template_id (str): The id of the template to remove the account's access from. account_id (str): The id ...
python
def remove_user_from_template(self, template_id, account_id=None, email_address=None): ''' Removes the specified Account's access to the specified Template Args: template_id (str): The id of the template to remove the account's access from. account_id (str): The id ...
Removes the specified Account's access to the specified Template Args: template_id (str): The id of the template to remove the account's access from. account_id (str): The id of the account to remove access from the template. The account id prevails if both account_id and e...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L761-L776
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.delete_template
def delete_template(self, template_id): ''' Deletes the specified template Args: template_id (str): The id of the template to delete Returns: A status code ''' url = self.TEMPLATE_DELETE_URL request = self._get_request() response = re...
python
def delete_template(self, template_id): ''' Deletes the specified template Args: template_id (str): The id of the template to delete Returns: A status code ''' url = self.TEMPLATE_DELETE_URL request = self._get_request() response = re...
Deletes the specified template Args: template_id (str): The id of the template to delete Returns: A status code
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L778-L795
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_template_files
def get_template_files(self, template_id, filename): ''' Download a PDF copy of a template's original files Args: template_id (str): The id of the template to retrieve. filename (str): Filename to save the PDF file to. This should be a full path. Returns: ...
python
def get_template_files(self, template_id, filename): ''' Download a PDF copy of a template's original files Args: template_id (str): The id of the template to retrieve. filename (str): Filename to save the PDF file to. This should be a full path. Returns: ...
Download a PDF copy of a template's original files Args: template_id (str): The id of the template to retrieve. filename (str): Filename to save the PDF file to. This should be a full path. Returns: Returns a PDF file
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L798-L815
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_embedded_template_draft
def create_embedded_template_draft(self, client_id, signer_roles, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, cc_roles=None, merge_fields=None, use_preexisting_fields=False): ''' Creates an embedded Template draft for further editing. Args: test_mod...
python
def create_embedded_template_draft(self, client_id, signer_roles, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, cc_roles=None, merge_fields=None, use_preexisting_fields=False): ''' Creates an embedded Template draft for further editing. Args: test_mod...
Creates an embedded Template draft for further editing. Args: test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to 1. Defaults to 0. client_id (str): Client id of the app you'...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L817-L868
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_team
def create_team(self, name): ''' Creates a new Team Creates a new Team and makes you a member. You must not currently belong to a team to invoke. Args: name (str): The name of your team Returns: A Team object ''' request = self._get_request() ...
python
def create_team(self, name): ''' Creates a new Team Creates a new Team and makes you a member. You must not currently belong to a team to invoke. Args: name (str): The name of your team Returns: A Team object ''' request = self._get_request() ...
Creates a new Team Creates a new Team and makes you a member. You must not currently belong to a team to invoke. Args: name (str): The name of your team Returns: A Team object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L888-L902
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.update_team_name
def update_team_name(self, name): ''' Updates a Team's name Args: name (str): The new name of your team Returns: A Team object ''' request = self._get_request() return request.post(self.TEAM_UPDATE_URL, {"name": name})
python
def update_team_name(self, name): ''' Updates a Team's name Args: name (str): The new name of your team Returns: A Team object ''' request = self._get_request() return request.post(self.TEAM_UPDATE_URL, {"name": name})
Updates a Team's name Args: name (str): The new name of your team Returns: A Team object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L906-L918
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.destroy_team
def destroy_team(self): ''' Delete your Team Deletes your Team. Can only be invoked when you have a team with only one member left (yourself). Returns: None ''' request = self._get_request() request.post(url=self.TEAM_DESTROY_URL, get_json=False)
python
def destroy_team(self): ''' Delete your Team Deletes your Team. Can only be invoked when you have a team with only one member left (yourself). Returns: None ''' request = self._get_request() request.post(url=self.TEAM_DESTROY_URL, get_json=False)
Delete your Team Deletes your Team. Can only be invoked when you have a team with only one member left (yourself). Returns: None
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L920-L930
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.add_team_member
def add_team_member(self, account_id=None, email_address=None): ''' Add or invite a user to your Team Args: account_id (str): The id of the account of the user to invite to your team. email_address (str): The email address of the account to invite to your team. The ac...
python
def add_team_member(self, account_id=None, email_address=None): ''' Add or invite a user to your Team Args: account_id (str): The id of the account of the user to invite to your team. email_address (str): The email address of the account to invite to your team. The ac...
Add or invite a user to your Team Args: account_id (str): The id of the account of the user to invite to your team. email_address (str): The email address of the account to invite to your team. The account id prevails if both account_id and email_address are provided. ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L932-L945
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.remove_team_member
def remove_team_member(self, account_id=None, email_address=None): ''' Remove a user from your Team Args: account_id (str): The id of the account of the user to remove from your team. email_address (str): The email address of the account to remove from your team. The ...
python
def remove_team_member(self, account_id=None, email_address=None): ''' Remove a user from your Team Args: account_id (str): The id of the account of the user to remove from your team. email_address (str): The email address of the account to remove from your team. The ...
Remove a user from your Team Args: account_id (str): The id of the account of the user to remove from your team. email_address (str): The email address of the account to remove from your team. The account id prevails if both account_id and email_address are provided. ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L948-L961
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_embedded_object
def get_embedded_object(self, signature_id): ''' Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for Returns: ...
python
def get_embedded_object(self, signature_id): ''' Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for Returns: ...
Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for Returns: An Embedded object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L966-L980
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_template_edit_url
def get_template_edit_url(self, template_id): ''' Retrieves a embedded template for editing Retrieves an embedded object containing a template url that can be opened in an iFrame. Args: template_id (str): The id of the template to get a signature url for Returns: ...
python
def get_template_edit_url(self, template_id): ''' Retrieves a embedded template for editing Retrieves an embedded object containing a template url that can be opened in an iFrame. Args: template_id (str): The id of the template to get a signature url for Returns: ...
Retrieves a embedded template for editing Retrieves an embedded object containing a template url that can be opened in an iFrame. Args: template_id (str): The id of the template to get a signature url for Returns: An Embedded object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L983-L997
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_unclaimed_draft
def create_unclaimed_draft(self, test_mode=False, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, form_fields_per_document=None, metadata=None, use_preexisting_fields=False, allow_decline=False): ''' Creates a new Draft t...
python
def create_unclaimed_draft(self, test_mode=False, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, form_fields_per_document=None, metadata=None, use_preexisting_fields=False, allow_decline=False): ''' Creates a new Draft t...
Creates a new Draft that can be claimed using the claim URL Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1001-L1074
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_embedded_unclaimed_draft
def create_embedded_unclaimed_draft(self, test_mode=False, client_id=None, is_for_embedded_signing=False, requester_email_address=None, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, requesting_redirect_url=None, form_fields_per...
python
def create_embedded_unclaimed_draft(self, test_mode=False, client_id=None, is_for_embedded_signing=False, requester_email_address=None, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, requesting_redirect_url=None, form_fields_per...
Creates a new Draft to be used for embedded requesting Args: test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False. client_id (str): Cli...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1076-L1154
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.create_embedded_unclaimed_draft_with_template
def create_embedded_unclaimed_draft_with_template(self, test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=Non...
python
def create_embedded_unclaimed_draft_with_template(self, test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=Non...
Creates a new Draft to be used for embedded requesting Args: test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False. client_id (str): ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1156-L1226
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.get_oauth_data
def get_oauth_data(self, code, client_id, client_secret, state): ''' Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app client_secret (str): Secret ...
python
def get_oauth_data(self, code, client_id, client_secret, state): ''' Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app client_secret (str): Secret ...
Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app client_secret (str): Secret token of the associated app Returns: A HSAccessTokenAuth...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1230-L1253
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient.refresh_access_token
def refresh_access_token(self, refresh_token): ''' Refreshes the current access token. Gets a new access token, updates client auth and returns it. Args: refresh_token (str): Refresh token to use Returns: The new access token ''' request = ...
python
def refresh_access_token(self, refresh_token): ''' Refreshes the current access token. Gets a new access token, updates client auth and returns it. Args: refresh_token (str): Refresh token to use Returns: The new access token ''' request = ...
Refreshes the current access token. Gets a new access token, updates client auth and returns it. Args: refresh_token (str): Refresh token to use Returns: The new access token
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1255-L1273
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._get_request
def _get_request(self, auth=None): ''' Return an http request object auth: Auth data to use Returns: A HSRequest object ''' self.request = HSRequest(auth or self.auth, self.env) self.request.response_callback = self.response_callback retu...
python
def _get_request(self, auth=None): ''' Return an http request object auth: Auth data to use Returns: A HSRequest object ''' self.request = HSRequest(auth or self.auth, self.env) self.request.response_callback = self.response_callback retu...
Return an http request object auth: Auth data to use Returns: A HSRequest object
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1286-L1296
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._authenticate
def _authenticate(self, email_address=None, password=None, api_key=None, access_token=None, access_token_type=None): ''' Create authentication object to send requests Args: email_address (str): Email address of the account to make the requests password (str): ...
python
def _authenticate(self, email_address=None, password=None, api_key=None, access_token=None, access_token_type=None): ''' Create authentication object to send requests Args: email_address (str): Email address of the account to make the requests password (str): ...
Create authentication object to send requests Args: email_address (str): Email address of the account to make the requests password (str): Password of the account used with email address api_key (str): API Key. You can find your API key in ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1298-L1328
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._check_required_fields
def _check_required_fields(self, fields=None, either_fields=None): ''' Check the values of the fields If no value found in `fields`, an exception will be raised. `either_fields` are the fields that one of them must have a value Raises: HSException: If no value found in at l...
python
def _check_required_fields(self, fields=None, either_fields=None): ''' Check the values of the fields If no value found in `fields`, an exception will be raised. `either_fields` are the fields that one of them must have a value Raises: HSException: If no value found in at l...
Check the values of the fields If no value found in `fields`, an exception will be raised. `either_fields` are the fields that one of them must have a value Raises: HSException: If no value found in at least one item of`fields`, or no value found in one of the items...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1330-L1353
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._send_signature_request
def _send_signature_request(self, test_mode=False, client_id=None, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None, allow_decline...
python
def _send_signature_request(self, test_mode=False, client_id=None, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None, allow_decline...
To share the same logic between send_signature_request & send_signature_request_embedded functions Args: test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False. client_id (str): ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1356-L1451
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._send_signature_request_with_template
def _send_signature_request_with_template(self, test_mode=False, client_id=None, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None, allow_decline=False): ''' To share the same logic b...
python
def _send_signature_request_with_template(self, test_mode=False, client_id=None, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None, allow_decline=False): ''' To share the same logic b...
To share the same logic between send_signature_request_with_template and send_signature_request_embedded_with_template Args: test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False. ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1454-L1550
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._create_unclaimed_draft
def _create_unclaimed_draft(self, test_mode=False, client_id=None, is_for_embedded_signing=False, requester_email_address=None, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, requesting_redirect_url=None, form_fields_per_documen...
python
def _create_unclaimed_draft(self, test_mode=False, client_id=None, is_for_embedded_signing=False, requester_email_address=None, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, requesting_redirect_url=None, form_fields_per_documen...
Creates a new Draft that can be claimed using the claim URL Args: test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False. client_id (str): ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1553-L1656
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._add_remove_user_template
def _add_remove_user_template(self, url, template_id, account_id=None, email_address=None): ''' Add or Remove user from a Template We use this function for two tasks because they have the same API call Args: template_id (str): The id of the template account_id (s...
python
def _add_remove_user_template(self, url, template_id, account_id=None, email_address=None): ''' Add or Remove user from a Template We use this function for two tasks because they have the same API call Args: template_id (str): The id of the template account_id (s...
Add or Remove user from a Template We use this function for two tasks because they have the same API call Args: template_id (str): The id of the template account_id (str): ID of the account to add/remove access to/from email_address (str): The email...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1659-L1696
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._add_remove_team_member
def _add_remove_team_member(self, url, email_address=None, account_id=None): ''' Add or Remove a team member We use this function for two different tasks because they have the same API call Args: email_address (str): Email address of the Account to add/remove ...
python
def _add_remove_team_member(self, url, email_address=None, account_id=None): ''' Add or Remove a team member We use this function for two different tasks because they have the same API call Args: email_address (str): Email address of the Account to add/remove ...
Add or Remove a team member We use this function for two different tasks because they have the same API call Args: email_address (str): Email address of the Account to add/remove account_id (str): ID of the Account to add/remove Returns: ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1699-L1732
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._create_embedded_template_draft
def _create_embedded_template_draft(self, client_id, signer_roles, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, cc_roles=None, merge_fields=None, use_preexisting_fields=False): ''' Helper method for creating embedded template drafts. See public function for pa...
python
def _create_embedded_template_draft(self, client_id, signer_roles, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, cc_roles=None, merge_fields=None, use_preexisting_fields=False): ''' Helper method for creating embedded template drafts. See public function for pa...
Helper method for creating embedded template drafts. See public function for params.
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1735-L1778
hellosign/hellosign-python-sdk
hellosign_sdk/hsclient.py
HSClient._create_embedded_unclaimed_draft_with_template
def _create_embedded_unclaimed_draft_with_template(self, test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=No...
python
def _create_embedded_unclaimed_draft_with_template(self, test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=No...
Helper method for creating unclaimed drafts from templates See public function for params.
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/hsclient.py#L1781-L1823
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest.get_file
def get_file(self, url, path_or_file=None, headers=None, filename=None): ''' Get a file from a url and save it as `filename` Args: url (str): URL to send the request to path_or_file (str or file): A writable File-like object or a path to save the file to. filename ...
python
def get_file(self, url, path_or_file=None, headers=None, filename=None): ''' Get a file from a url and save it as `filename` Args: url (str): URL to send the request to path_or_file (str or file): A writable File-like object or a path to save the file to. filename ...
Get a file from a url and save it as `filename` Args: url (str): URL to send the request to path_or_file (str or file): A writable File-like object or a path to save the file to. filename (str): [DEPRECATED] File name to save the file as, this can be either ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L69-L111
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest.get
def get(self, url, headers=None, parameters=None, get_json=True): ''' Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameters R...
python
def get(self, url, headers=None, parameters=None, get_json=True): ''' Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameters R...
Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameters Returns: A JSON object of the returned response if `get_json` is Tr...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L113-L143
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest.post
def post(self, url, data=None, files=None, headers=None, get_json=True): ''' Make POST request to a url Args: url (str): URL to send the request to data (dict, optional): Data to send files (dict, optional): Files to send with the request headers (str, op...
python
def post(self, url, data=None, files=None, headers=None, get_json=True): ''' Make POST request to a url Args: url (str): URL to send the request to data (dict, optional): Data to send files (dict, optional): Files to send with the request headers (str, op...
Make POST request to a url Args: url (str): URL to send the request to data (dict, optional): Data to send files (dict, optional): Files to send with the request headers (str, optional): custom headers Returns: A JSON object of the returned r...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L145-L170
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest._get_json_response
def _get_json_response(self, resp): ''' Parse a JSON response ''' if resp is not None and resp.text is not None: try: text = resp.text.strip('\n') if len(text) > 0: return json.loads(text) except ValueError as e: ...
python
def _get_json_response(self, resp): ''' Parse a JSON response ''' if resp is not None and resp.text is not None: try: text = resp.text.strip('\n') if len(text) > 0: return json.loads(text) except ValueError as e: ...
Parse a JSON response
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L175-L185
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest._process_json_response
def _process_json_response(self, response): ''' Process a given response ''' json_response = self._get_json_response(response) if self.response_callback is not None: json_response = self.response_callback(json_response) response._content = json.dumps(json_respon...
python
def _process_json_response(self, response): ''' Process a given response ''' json_response = self._get_json_response(response) if self.response_callback is not None: json_response = self.response_callback(json_response) response._content = json.dumps(json_respon...
Process a given response
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L199-L212
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest._check_error
def _check_error(self, response, json_response=None): ''' Check for HTTP error code from the response, raise exception if there's any Args: response (object): Object returned by requests' `get` and `post` methods json_response (dict): JSON response, if applicabl...
python
def _check_error(self, response, json_response=None): ''' Check for HTTP error code from the response, raise exception if there's any Args: response (object): Object returned by requests' `get` and `post` methods json_response (dict): JSON response, if applicabl...
Check for HTTP error code from the response, raise exception if there's any Args: response (object): Object returned by requests' `get` and `post` methods json_response (dict): JSON response, if applicable Raises: HTTPError: If the status code of re...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L214-L242
hellosign/hellosign-python-sdk
hellosign_sdk/utils/request.py
HSRequest._check_warnings
def _check_warnings(self, json_response): ''' Extract warnings from the response to make them accessible Args: json_response (dict): JSON response ''' self.warnings = None if json_response: self.warnings = json_response.get('warnings') ...
python
def _check_warnings(self, json_response): ''' Extract warnings from the response to make them accessible Args: json_response (dict): JSON response ''' self.warnings = None if json_response: self.warnings = json_response.get('warnings') ...
Extract warnings from the response to make them accessible Args: json_response (dict): JSON response
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/request.py#L244-L258
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsaccesstokenauth.py
HSAccessTokenAuth.from_response
def from_response(self, response_data): ''' Builds a new HSAccessTokenAuth straight from response data Args: response_data (dict): Response data to use Returns: A HSAccessTokenAuth objet ''' return HSAccessTokenAuth( response_data['access_t...
python
def from_response(self, response_data): ''' Builds a new HSAccessTokenAuth straight from response data Args: response_data (dict): Response data to use Returns: A HSAccessTokenAuth objet ''' return HSAccessTokenAuth( response_data['access_t...
Builds a new HSAccessTokenAuth straight from response data Args: response_data (dict): Response data to use Returns: A HSAccessTokenAuth objet
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsaccesstokenauth.py#L53-L69
hellosign/hellosign-python-sdk
hellosign_sdk/resource/signature_request.py
SignatureRequest.find_response_component
def find_response_component(self, api_id=None, signature_id=None): ''' Find one or many repsonse components. Args: api_id (str): Api id associated with the component(s) to be retrieved. signature_id (str): Signature id associated with the component(s)...
python
def find_response_component(self, api_id=None, signature_id=None): ''' Find one or many repsonse components. Args: api_id (str): Api id associated with the component(s) to be retrieved. signature_id (str): Signature id associated with the component(s)...
Find one or many repsonse components. Args: api_id (str): Api id associated with the component(s) to be retrieved. signature_id (str): Signature id associated with the component(s) to be retrieved. Returns: A list of dictionaries ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/resource/signature_request.py#L114-L137
hellosign/hellosign-python-sdk
hellosign_sdk/resource/signature_request.py
SignatureRequest.find_signature
def find_signature(self, signature_id=None, signer_email_address=None): ''' Return a signature for the given parameters Args: signature_id (str): Id of the signature to retrieve. signer_email_address (str): Email address of the associated signer for ...
python
def find_signature(self, signature_id=None, signer_email_address=None): ''' Return a signature for the given parameters Args: signature_id (str): Id of the signature to retrieve. signer_email_address (str): Email address of the associated signer for ...
Return a signature for the given parameters Args: signature_id (str): Id of the signature to retrieve. signer_email_address (str): Email address of the associated signer for the signature to retrieve. Returns: A Signature object ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/resource/signature_request.py#L139-L154
hellosign/hellosign-python-sdk
hellosign_sdk/utils/__init__.py
api_resource._uncamelize
def _uncamelize(self, s): ''' Convert a camel-cased string to using underscores ''' res = '' if s: for i in range(len(s)): if i > 0 and s[i].lower() != s[i]: res += '_' res += s[i].lower() return res
python
def _uncamelize(self, s): ''' Convert a camel-cased string to using underscores ''' res = '' if s: for i in range(len(s)): if i > 0 and s[i].lower() != s[i]: res += '_' res += s[i].lower() return res
Convert a camel-cased string to using underscores
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/__init__.py#L53-L61
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_file_params
def format_file_params(files): ''' Utility method for formatting file parameters for transmission ''' files_payload = {} if files: for idx, filename in enumerate(files): files_payload["file[" + str(idx) + "]"] = open(filename, 'rb') return ...
python
def format_file_params(files): ''' Utility method for formatting file parameters for transmission ''' files_payload = {} if files: for idx, filename in enumerate(files): files_payload["file[" + str(idx) + "]"] = open(filename, 'rb') return ...
Utility method for formatting file parameters for transmission
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L41-L49
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_file_url_params
def format_file_url_params(file_urls): ''' Utility method for formatting file URL parameters for transmission ''' file_urls_payload = {} if file_urls: for idx, fileurl in enumerate(file_urls): file_urls_payload["file_url[" + str(idx) + "]"] = fileu...
python
def format_file_url_params(file_urls): ''' Utility method for formatting file URL parameters for transmission ''' file_urls_payload = {} if file_urls: for idx, fileurl in enumerate(file_urls): file_urls_payload["file_url[" + str(idx) + "]"] = fileu...
Utility method for formatting file URL parameters for transmission
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L52-L60
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_param_list
def format_param_list(listed_params, output_name): ''' Utility method for formatting lists of parameters for api consumption Useful for email address lists, etc Args: listed_params (list of values) - the list to format output_name (str) - the p...
python
def format_param_list(listed_params, output_name): ''' Utility method for formatting lists of parameters for api consumption Useful for email address lists, etc Args: listed_params (list of values) - the list to format output_name (str) - the p...
Utility method for formatting lists of parameters for api consumption Useful for email address lists, etc Args: listed_params (list of values) - the list to format output_name (str) - the parameter name to prepend to each key
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L63-L75
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_dict_list
def format_dict_list(list_of_dicts, output_name, key=None): ''' Utility method for formatting lists of dictionaries for api consumption. Takes something like [{name: val1, email: val2},{name: val1, email: val2}] for signers and outputs: signers[0][name] : val1 ...
python
def format_dict_list(list_of_dicts, output_name, key=None): ''' Utility method for formatting lists of dictionaries for api consumption. Takes something like [{name: val1, email: val2},{name: val1, email: val2}] for signers and outputs: signers[0][name] : val1 ...
Utility method for formatting lists of dictionaries for api consumption. Takes something like [{name: val1, email: val2},{name: val1, email: val2}] for signers and outputs: signers[0][name] : val1 signers[0][email] : val2 ... Args: ...
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L78-L103
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_single_dict
def format_single_dict(dictionary, output_name): ''' Currently used for metadata fields ''' output_payload = {} if dictionary: for (k, v) in dictionary.items(): output_payload[output_name + '[' + k + ']'] = v return output_payload
python
def format_single_dict(dictionary, output_name): ''' Currently used for metadata fields ''' output_payload = {} if dictionary: for (k, v) in dictionary.items(): output_payload[output_name + '[' + k + ']'] = v return output_payload
Currently used for metadata fields
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L106-L114
hellosign/hellosign-python-sdk
hellosign_sdk/utils/hsformat.py
HSFormat.format_custom_fields
def format_custom_fields(list_of_custom_fields): ''' Custom fields formatting for submission ''' output_payload = {} if list_of_custom_fields: # custom_field: {"name": value} for custom_field in list_of_custom_fields: for key, value in ...
python
def format_custom_fields(list_of_custom_fields): ''' Custom fields formatting for submission ''' output_payload = {} if list_of_custom_fields: # custom_field: {"name": value} for custom_field in list_of_custom_fields: for key, value in ...
Custom fields formatting for submission
https://github.com/hellosign/hellosign-python-sdk/blob/4325a29ad5766380a214eac3914511f62f7ecba4/hellosign_sdk/utils/hsformat.py#L117-L127
alejandrobll/py-sphviewer
sphviewer/Render.py
Render.set_logscale
def set_logscale(self,t=True): """ - set_logscale(): If M is the matrix of the image, it defines the image M as log10(M+1). """ if(t == self.get_logscale()): return else: if(t): self.__image = np.log10(self.__image+1) self._...
python
def set_logscale(self,t=True): """ - set_logscale(): If M is the matrix of the image, it defines the image M as log10(M+1). """ if(t == self.get_logscale()): return else: if(t): self.__image = np.log10(self.__image+1) self._...
- set_logscale(): If M is the matrix of the image, it defines the image M as log10(M+1).
https://github.com/alejandrobll/py-sphviewer/blob/f198bd9ed5adfb58ebdf66d169206e609fd46e42/sphviewer/Render.py#L144-L156
alejandrobll/py-sphviewer
sphviewer/Render.py
Render.histogram
def histogram(self,axis=None, **kargs): """ - histogram(axis=None, **kargs): It computes and shows the histogram of the image. This is usefull for choosing a proper scale to the output, or for clipping some values. If axis is None, it selects the current axis to plot the histogram. ...
python
def histogram(self,axis=None, **kargs): """ - histogram(axis=None, **kargs): It computes and shows the histogram of the image. This is usefull for choosing a proper scale to the output, or for clipping some values. If axis is None, it selects the current axis to plot the histogram. ...
- histogram(axis=None, **kargs): It computes and shows the histogram of the image. This is usefull for choosing a proper scale to the output, or for clipping some values. If axis is None, it selects the current axis to plot the histogram. Keyword arguments: *bins*: ...
https://github.com/alejandrobll/py-sphviewer/blob/f198bd9ed5adfb58ebdf66d169206e609fd46e42/sphviewer/Render.py#L164-L314
alejandrobll/py-sphviewer
sphviewer/Render.py
Render.save
def save(self,outputfile,**kargs): """ - Save the image in some common image formats. It uses the pyplot.save method. outputfile is a string containing a path to a filename, of a Python file-like object. If *format* is *None* and *fname* is a string, the output format...
python
def save(self,outputfile,**kargs): """ - Save the image in some common image formats. It uses the pyplot.save method. outputfile is a string containing a path to a filename, of a Python file-like object. If *format* is *None* and *fname* is a string, the output format...
- Save the image in some common image formats. It uses the pyplot.save method. outputfile is a string containing a path to a filename, of a Python file-like object. If *format* is *None* and *fname* is a string, the output format is deduced from the extension of the filename....
https://github.com/alejandrobll/py-sphviewer/blob/f198bd9ed5adfb58ebdf66d169206e609fd46e42/sphviewer/Render.py#L316-L344
alejandrobll/py-sphviewer
sphviewer/Scene.py
Scene.set_autocamera
def set_autocamera(self,mode='density'): """ - set_autocamera(mode='density'): By default, Scene defines its own Camera. However, there is no a general way for doing so. Scene uses a density criterion for getting the point of view. If this is not a good option for your problem...
python
def set_autocamera(self,mode='density'): """ - set_autocamera(mode='density'): By default, Scene defines its own Camera. However, there is no a general way for doing so. Scene uses a density criterion for getting the point of view. If this is not a good option for your problem...
- set_autocamera(mode='density'): By default, Scene defines its own Camera. However, there is no a general way for doing so. Scene uses a density criterion for getting the point of view. If this is not a good option for your problem, you can choose among: |'minmax'|'density'|'median'|...
https://github.com/alejandrobll/py-sphviewer/blob/f198bd9ed5adfb58ebdf66d169206e609fd46e42/sphviewer/Scene.py#L116-L128
alejandrobll/py-sphviewer
sphviewer/Scene.py
Scene.get_scene
def get_scene(self): """ - get_scene(): It return the x and y position, the smoothing length of the particles and the index of the particles that are active in the scene. In principle this is an internal function and you don't need this data. """ return self._...
python
def get_scene(self): """ - get_scene(): It return the x and y position, the smoothing length of the particles and the index of the particles that are active in the scene. In principle this is an internal function and you don't need this data. """ return self._...
- get_scene(): It return the x and y position, the smoothing length of the particles and the index of the particles that are active in the scene. In principle this is an internal function and you don't need this data.
https://github.com/alejandrobll/py-sphviewer/blob/f198bd9ed5adfb58ebdf66d169206e609fd46e42/sphviewer/Scene.py#L130-L137