You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

kenv

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kenv - pypi Package Compare versions

Comparing version
0.3.0.0
to
0.3.0.1
+3
-3
kenv.egg-info/PKG-INFO
Metadata-Version: 2.1
Name: kenv
Version: 0.3.0.0
Version: 0.3.0.1
Summary: Kapchinscky ENVelope (KENV) - solver of the Kapchinsky-Vladimirsky envelope equation

@@ -22,3 +22,3 @@ Home-page: https://github.com/fuodorov/kenv

In order to use the KENV code correctly, it is **important to read the [Wiki](https://github.com/fuodorov/kenv/wiki).**
In order to use the KENV code correctly, it is **important to read the [Doc](https://fuodorov.github.io/kenv/).**

@@ -43,3 +43,3 @@ ## Algorithm

[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.
[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.

@@ -46,0 +46,0 @@ Platform: UNKNOWN

@@ -6,3 +6,3 @@ from .constants import *

__version__ = '0.3.0.0'
__version__ = '0.3.0.1'
__doc__ = """Kapchinscky ENVelope (KENV) -

@@ -9,0 +9,0 @@ solver of the Kapchinsky-Vladimirsky envelope equation"""

@@ -8,14 +8,5 @@ import numpy as np

class Element:
"""Sets one accelerator element.
"""
Sets one accelerator element.
Sets one accelerator element with parameters:
z0 [m] --- element position,
max_field --- maximum field,
file_name --- field profile,
name --- unique element name,
and shifted by x, xp, y, yp,
and z_start, z_stop, length
"""

@@ -33,2 +24,25 @@

yp: float = 0.0):
"""
Initialization of an accelerator element.
Parameters
----------
z0: float
Position of the element center
max_field: float
Maximum value of the field on the element axis
file_name: string
Name of the file
name: string
Name of the element
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""
self.z0 = z0

@@ -51,8 +65,20 @@ self.max_field = max_field

z: np.arange) -> interpolate.interp1d:
"""Sews elements into a function of z.
"""
Field reading function.
Sews elements into a function of z with parameters:
beamline --- set of accelerator elements,
z [m] --- coordinate.
Parameters
----------
beamline: dict
Accelerator`s beamline
z: an instance of the `np.arange` class
Axis z
Returns
-------
F: an instance of the `interpolate.interp1d` class
Field function
F_prime: an instance of the `interpolate.interp1d` class
Field prime function
F_int: an instance of the `interpolate.interp1d` class
Field integrate function
"""

@@ -128,8 +154,22 @@

z: np.arange) -> interpolate.interp1d:
"""Sews elements into a function of z.
"""
Offsets and rotations reading function.
Sews elements into a function of z with parameters:
beamline --- set of accelerator elements,
z [m] --- coordinate.
Parameters
----------
beamline: dict
Accelerator`s beamline
z: an instance of the `np.arange` class
Axis z
Returns
-------
offset_correct_x: an instance of the `interpolate.interp1d` class
Offset function
offset_correct_xp: an instance of the `interpolate.interp1d` class
Rotation function
offset_correct_y: an instance of the `interpolate.interp1d` class
Offset function
offset_correct_yp: an instance of the `interpolate.interp1d` class
Rotation function
"""

@@ -238,23 +278,12 @@

class Accelerator:
"""Create an accelerator.
"""
Top-level accelerator class that contains all the accelerator data.
Create an accelerator with parameters:
z_start [m] --- the beginning of the accelerator,
z_stop [m] --- end of the accelerator,
dz [m] --- step method along the accelerator.
The `Accelerator` class has several important attributes:
Can add a solenoids, quadrupoles and accelerating modules.
Accelerator's parameters after compile:
beamline:
Bz_beamline, Ez_beamline, Gz_beamline,
Bx_beamline, By_beamline,
function:
Ez, Bz, Gz, Bx, By,
Dx, Dxp, Dy, Dyp,
and
dEzdz, dBzdz, dGzdz, dBxdz, dBydz,
and
Ezdz, Bzdz, Gzdz, Bxdz, Bydz
- `Bx_beamline`, a beamline which contains the solenoids information
- `By_beamline`, a beamline which contains the solenoids information
- `Bz_beamline`, a beamline which contains the solenoids information
- `Ez_beamline`, a beamline which contains the accels information
- `Gz_beamline`, a beamline which contains the quadrupoles information
"""

@@ -266,2 +295,14 @@

dz: float):
"""
Initializes an accelerator.
Parameters
----------
z_start: float
The position of the start of the accelerator
z_stop: float
The position of the end of the accelerator
dz: float
The step of the accelerator
"""
self.z_start = self.start = z_start

@@ -299,11 +340,24 @@ self.z_stop = self.stop = z_stop

yp: float = 0.0) -> None:
"""Creates a solenoid in the accelerator.
"""
Creates a solenoid lenses in the accelerator.
Creates a solenoid in the accelerator with parameters:
name --- solenoid's id,
center [m] --- solenoid's center,
max_field [T] --- solenoid's maximum field,
file_name --- experimental profile of the Bz field
and shifted by x [m], xp [rad], y [m], yp [rad]
Parameters
----------
name: string
Solenoid's id,
center: float
Solenoid's center,
max_field: float
Solenoid's maximum field [T],
file_name: string
Experimental profile of the Bz field
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""

@@ -323,11 +377,24 @@ self.Bz_beamline[name] = Element(center, max_field, file_name, name,

yp: float = 0.0) -> None:
"""Creates an accelerating module in the accelerator.
"""
Creates an accelerating module in the accelerator.
Creates an accelerating module in the accelerator with parameters:
name --- accelerating module's id,
center [m] --- accelerating module's center,
max_field [MV/m] --- accelerating module's maximum field,
file_name --- experimental profile of the Ez field
and shifted by x [m], xp [rad], y [m], yp [rad]
Parameters
----------
name: string
Accel's id,
center: float
Accel's center,
max_field: float
Accel's maximum field [MV/m],
file_name: string
Experimental profile of the Ez field
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""

@@ -342,10 +409,24 @@ self.Ez_beamline[name] = Element(center, max_field, file_name, name,

file_name: str) -> None:
"""Creates a quadrupole in the accelerator.
"""
Creates a quadrupole in the accelerator.
Creates a quadrupole in the accelerator with parameters:
name --- quadrupole's id,
center [m] --- quadrupole's center,
max_field [T/m] --- quadrupole's maximum field,
file_name --- experimental profile of the Gz field
Parameters
----------
name: string
Quad's id,
center: float
Quad's center,
max_field: float
Quad's maximum field [T/m],
file_name: string
Experimental profile of the Gz field
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""

@@ -359,10 +440,24 @@ self.Gz_beamline[name] = Element(center, max_field, file_name, name)

file_name: str) -> None:
"""Creates a corrector in the accelerator.
"""
Creates a corrector x in the accelerator.
Creates a corrector in the accelerator with parameters:
name --- corrector's id,
center [m] --- corrector's center,
max_field [T] --- corrector's maximum field,
file_name --- experimental profile of the By field
Parameters
----------
name: string
Corrector's id,
center: float
Corrector's center,
max_field: float
Corrector's maximum field [T],
file_name: string
Experimental profile of the By field
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""

@@ -376,22 +471,36 @@ self.By_beamline[name] = Element(center, max_field, file_name, name)

file_name: str) -> None:
"""Creates a corrector in the accelerator.
"""
Creates a corrector y in the accelerator.
Creates a corrector in the accelerator with parameters:
name --- corrector's id,
center [m] --- corrector's center,
max_field [T] --- corrector's maximum field,
file_name --- experimental profile of the Bx field
Parameters
----------
name: string
Corrector's id,
center: float
Corrector's center,
max_field: float
Corrector's maximum field [T],
file_name: string
Experimental profile of the Bx field
x: float, optional
Offset of the element along the x-axis
xp: float, optional
Element rotation in the z-x plane
y: float, optional
Offset of the element along the y-axis
yp: float, optional
Element rotation in the z-y plane
"""
self.Bx_beamline[name] = Element(center, max_field, file_name, name)
def delete_solenoid(self,
name: str = 'all') -> None:
"""Delete a solenoid in the accelerator.
def delete_solenoid(self, name: str = 'all') -> None:
"""
Delete a solenoid in the accelerator.
Delete a solenoid in the accelerator with parameters:
name --- solenoid's id
*if there is no name that will be removed all
Parameters
----------
name: string
Solenoid`s id
(If there is no name that will be removed all)
"""

@@ -403,11 +512,11 @@ if name == 'all':

def delete_accel(self,
name: str = 'all') -> None:
"""Delete a accelerating module in the accelerator.
def delete_accel(self, name: str = 'all') -> None:
"""
Delete an accelerating module in the accelerator.
Delete a accelerating module in the accelerator with parameters:
name --- accel's id
*if there is no name that will be removed all
Parameters
----------
name: string
Accel`s id
(If there is no name that will be removed all)
"""

@@ -419,11 +528,11 @@ if name == 'all':

def delete_quadrupole(self,
name: str = 'all') -> None:
"""Delete a quadrupole in the accelerator.
def delete_quadrupole(self, name: str = 'all') -> None:
"""
Delete a quadrupole in the accelerator.
Delete a quadrupole in the accelerator with parameters:
name --- quadrupole's id
*if there is no name that will be removed all
Parameters
----------
name: string
Quad`s id
(If there is no name that will be removed all)
"""

@@ -435,11 +544,11 @@ if name == 'all':

def delete_corrector_x(self,
name: str = 'all') -> None:
"""Delete a corrector in the accelerator.
def delete_corrector_x(self, name: str = 'all') -> None:
"""
Delete a corrector x in the accelerator.
Delete a corrector in the accelerator with parameters:
name --- corrector's id
*if there is no name that will be removed all
Parameters
----------
name: string
Corrector`s id
(If there is no name that will be removed all)
"""

@@ -451,11 +560,11 @@ if name == 'all':

def delete_corrector_y(self,
name: str = 'all') -> None:
"""Delete a corrector in the accelerator.
def delete_corrector_y(self, name: str = 'all') -> None:
"""
Delete a corrector y in the accelerator.
Delete a corrector in the accelerator with parameters:
name --- corrector's id
*if there is no name that will be removed all
Parameters
----------
name: string
Corrector`s id
(If there is no name that will be removed all)
"""

@@ -468,3 +577,5 @@ if name == 'all':

def compile(self) -> None:
"""Compilation of the accelerator."""
"""
Compilation of the accelerator.
"""

@@ -471,0 +582,0 @@ self.Bx, self.dBxdz, self.Bxdz = read_fields(self.Bx_beamline,

Metadata-Version: 2.1
Name: kenv
Version: 0.3.0.0
Version: 0.3.0.1
Summary: Kapchinscky ENVelope (KENV) - solver of the Kapchinsky-Vladimirsky envelope equation

@@ -22,3 +22,3 @@ Home-page: https://github.com/fuodorov/kenv

In order to use the KENV code correctly, it is **important to read the [Wiki](https://github.com/fuodorov/kenv/wiki).**
In order to use the KENV code correctly, it is **important to read the [Doc](https://fuodorov.github.io/kenv/).**

@@ -43,3 +43,3 @@ ## Algorithm

[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.
[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.

@@ -46,0 +46,0 @@ Platform: UNKNOWN

@@ -14,3 +14,3 @@ # Kapchinsky ENVelope (KENV)

In order to use the KENV code correctly, it is **important to read the [Wiki](https://github.com/fuodorov/kenv/wiki).**
In order to use the KENV code correctly, it is **important to read the [Doc](https://fuodorov.github.io/kenv/).**

@@ -35,2 +35,2 @@ ## Algorithm

[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.
[Publication](http://www1.jinr.ru/Pepan_letters/panl_2020_2/13_nikifor.pdf) in Particles and Nuclei.