Main

class jwst.associations.Main(args=None, pool=None)[source]

Bases: object

Generate Associations from an Association Pool

Parameters:
  • args ([str, ...], or None) –

    The command line arguments. Can be one of

    • None: sys.argv is then used.

    • [str, ...]: A list of strings which create the command line with the similar structure as sys.argv

  • pool (None or AssociationPool) – If None, a pool file must be specified in the args. Otherwise, an AssociationPool

pool

The pool read in, or passed in through the parameter pool

Type:

AssociationPool

rules

The rules used for association creation.

Type:

AssociationRegistry

associations

The list of generated associations.

Type:

[Association, …]

Notes

Refer to the Association Generator documentation for a full description.

Attributes Summary

orphaned

The pool of exposures that do not belong to any association.

Methods Summary

cli([args, pool])

Run the full association generation process

configure([args, pool])

Configure to prepare for generation

generate()

Generate the associations

parse_args([args, has_pool])

Set command line arguments

save()

Save the associations to disk.

Attributes Documentation

orphaned

The pool of exposures that do not belong to any association.

Methods Documentation

classmethod cli(args=None, pool=None)[source]

Run the full association generation process

Parameters:
  • args ([str, ...], or None) –

    The command line arguments. Can be one of

    • None: sys.argv is then used.

    • [str, ...]: A list of strings which create the command line with the similar structure as sys.argv

  • pool (None or AssociationPool) – If None, a pool file must be specified in the args. Otherwise, an AssociationPool

Returns:

generator – A fully executed association generator.

Return type:

Main

configure(args=None, pool=None)[source]

Configure to prepare for generation

Parameters:
  • args ([str, ...], or None) –

    The command line arguments. Can be one of

    • None: sys.argv is then used.

    • [str, ...]: A list of strings which create the command line with the similar structure as sys.argv

  • pool (None or AssociationPool) – If None, a pool file must be specified in the args. Otherwise, an AssociationPool

generate()[source]

Generate the associations

parse_args(args=None, has_pool=False)[source]

Set command line arguments

Parameters:
  • args (list, str, or None) – List of command-line arguments. If a string, spaces seperate the arguments. If None, sys.argv is used.

  • has_pool (bool-like) – Do not require pool from the command line if a pool is already in hand.

save()[source]

Save the associations to disk.