Skip to main content

Cython binding to MAD-X

Project description

Latest Version License: CC0, Apache, Non-Free Python versions Test Status Coverage

cpymad is a Cython binding to MAD-X (MAD-X source).

This version of cpymad should be built against MAD-X 5.04.00.

cpymad is NOT maintained by CERN members and links against an unofficial build of MAD-X that is not supported by CERN, i.e. this binary may have problems that the official binary does not have and vice versa. See also: Reporting issues.

License

White the cpymad source code itself is under free license, the MAD-X software package is NOT FREE. For more details, see COPYING.rst.

Reporting issues

If you have a problem with a sequence file, first try to check if that problem remains when using the MAD-X command line client distributed by CERN, then:

  • Report the issue to CERN only if it can be reproduced with their official command line client.

  • Report the issue here only if it can not be reproduced with their official command line client.

For issues regarding the cpymad code itself or usage information, I’m happy to answer. Just keep in mind to be precise, specific, concise and provide all the necessary information.

Changelog

1.0.0rc2

Date: 15.05.2018

  • serve globals as Parameter instances from libmadx module

  • add cmdpar attribute to globals

1.0.0rc1

Date: 13.05.2018

Collecting further backward incompatibilities before the final 1.0 release, as well as minor bugfixes.

  • only execute variable updates if their value has changed

  • use __slots__ for Parameter

  • remove cpymad-specific behaviour for Madx.select

  • allow direct access to MAD-X commands as attributes on the Madx instance

  • rename Parameter.argument to Parameter.definition

  • add VarList.defs, Command.defs instance variables for accessing the definitions (provisional API)

  • create the accessor proxies in advance

  • disallow indexing ElementList by dict instances (i.e. by element object)

  • handle uppercase ‘#S’ and ‘#E’ in ElementList

1.0.0rc0

Date: 16.04.2018

First pre-release for 1.0.0 with several backward incompatibilities.

  • the Madx methods have been simplified to be only thin wrappers over the corresponding MAD-X commands, not taking any extra responsibilities such as automatically using sequences etc.

  • rename Madx.tables/sequences to singular form

  • disable passing dicts as range parameter for commands

  • remove cpymad.util.is_match_param.

  • remove cpymad.libmadx.set_var routine. Always use input!

  • remove Madx.get_table method, use Madx.table.X instead

  • rename Madx.evaluate to eval

  • remove Madx.set_value/set_expression/update_value. Use assignment to attributes of Madx.globals/command/element instead.

  • rename util.mad_command -> format_command

  • only ignore None parameters when generating MAD-X commands. This allows passing empty strings.

  • remove cpymad.types.Expression, replaced by new Parameter class, see below.

  • remove Madx.active_sequence, use Madx.sequence() instead

  • the at/l attributes are now kept as the values specified by the user (relative to refer flag), and not overwritten anymore by the actual position or length. Use .position and .length attributes to access the node position/length instead!

  • the name attribute is now the command/element name. The node name is now available as node_name.

Introduced a new API for accessing additional metadata about command parameters:

  • added a Command.cmdpar.X namespace that can be used to retrieve a Parameter instance with additional metadata about the command parameter.

  • rigorously distinguish between MAD-X command parameters and other attributes on elements/commands

  • only command parameters can be accessed using the dict-like item access syntax while other metadata can only be accessed via attribute access

  • use the type information for improving the composition of MAD-X command statements

Misc changes:

  • add method Madx.sectortable2 to access 2nd order sector map (as well as related methods to Table). Method name is subject to change!

  • show implicit drifts with [0] again (the suffix is needed when matching on implicit drifts)

  • perfect kwargs forwarding

  • expose occ_count/enable/base_name attributes on nodes

Older versions

The full changelog is available online in CHANGES.rst.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpymad-1.0.0rc2.tar.gz (159.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page