Skip to content

Commit 33f8ced

Browse files
Multiple changes (#21)
- add docstrings and type hints - rename _Base to Object - move length property to Object - update __str__ function of Object - update gitignore - Changes size of some arrays: - removed identity matrix from acc_array now has size of n_kicks - step_size array now has size of n_kicks - orbit position now has sizeo of n_kicks + 1 - also updated c files accordingly - added user guide dba example - added test for removing and adding objects to cell - some code refactoring
1 parent d99e4a3 commit 33f8ced

28 files changed

+604
-318
lines changed

.gitignore

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
# OS and IDE
12
.DS_Store
2-
.env
3+
.idea
4+
.vscode
5+
36

47
# Byte-compiled / optimized / DLL files
58
__pycache__/
69
*.py[cod]
710
*$py.class
811

912
# C extensions
10-
# TODO: .o/.c files should be deleted automatically
1113
apace/**/*.so
1214
apace/**/*.o
1315
apace/**/*.c
@@ -18,12 +20,18 @@ apace/**/*.c
1820
build/
1921
dist/
2022
sdist/
23+
wheels/
2124
*.egg
2225
*.egg-info/
2326

24-
# IDE
25-
.idea
26-
.vscode
27+
# Unit test / coverage reports
28+
.pytest_cache/
29+
30+
# Sphinx documentation
31+
docs/_build/
32+
33+
# Enviroments
34+
.env
2735

2836
# output
2937
output/

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
include *.in
12
recursive-include cffi_build *.py
3+
recursive-include docs *.bat
4+
recursive-include docs *.gitkeep
5+
recursive-include docs *.py
6+
recursive-include docs *.rst
7+
recursive-include docs *.txt
8+
recursive-include docs Makefile
9+
prune docs/_build
210
recursive-include examples *.json
311
recursive-include examples *.py
412
recursive-include lib *.c

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Python Version](https://img.shields.io/pypi/pyversions/apace)](https://pypi.org/project/apace/)
33
[![PyPI](https://img.shields.io/pypi/v/apace.svg)](https://pypi.org/project/apace/)
44
[![CI](https://github.com/andreasfelix/apace/workflows/CI/badge.svg)](https://github.com/andreasfelix/apace/actions?query=workflow%3ACI)
5-
[![Docs](https://readthedocs.org/projects/apace/badge/?version=docs)](https://apace.readthedocs.io/en/docs/)
5+
[![Docs](https://readthedocs.org/projects/apace/badge/?version=latest)](https://apace.readthedocs.io/en/docs/)
66

77
**apace** is yet **a**nother **p**article **a**ccelerator **c**od**e** designed for the optimization of beam optics. It is available as Python package and aims to provide a convenient and straightforward API to make use of Python's numerous scientific libraries.
88

@@ -15,7 +15,7 @@ pip install -U apace
1515
```
1616

1717
## Requirements
18-
- Python 3.7 or higher (CPython or PyPy)
18+
- Python 3.6 or higher (CPython or PyPy)
1919
- CFFI 1.0.0 or higher
2020
- NumPy/SciPy
2121
- Matplotlib
@@ -42,7 +42,6 @@ Calculate the Twiss parameters:
4242
twiss = ap.Twiss(ring)
4343
```
4444

45-
4645
Plot horizontal and vertical beta functions using matplotlib:
4746
```python
4847
import matplotlib.pyplot as plt

apace/__about__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
__version__ = '0.0.1'
55
__author__ = 'Felix Andreas'
66
__license__ = 'GNU General Public License v3.0'
7-
__copyright__ = 'Copyright 2019 Felix Andreas'

apace/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from .__about__ import __license__, __author__, __version__, __copyright__
2-
from .classes import Drift, Bend, Quad, Sext, Cell
3-
from .matrix_method import MatrixMethod
4-
from .matrix_tracking import MatrixTracking
1+
from .__about__ import __version__, __license__, __author__
2+
from .classes import Object, Element, Drift, Bend, Quad, Sext, Octu, Cell
3+
from .io import load_lattice, save_lattice
54
from .twiss import Twiss
6-
from .io import read_lattice_file, save_lattice_file
5+
from .matrix_tracking import MatrixTracking
76
from .distributions import create_particle_distribution
7+
from .matrix_method import MatrixMethod
88
from .utils import Signal, AmbiguousNameError

0 commit comments

Comments
 (0)