autowisp.fit_expression.process_terms_visitor module

Class Inheritance Diagram

Inheritance diagram of ABC, FitTermsParser, FitTermsParserVisitor, ProcessTermsVisitor

Implement base visitor class for processing individual terms in expression

class autowisp.fit_expression.process_terms_visitor.ProcessTermsVisitor[source]

Bases: FitTermsParserVisitor, ABC

Inheritance diagram of autowisp.fit_expression.process_terms_visitor.ProcessTermsVisitor

Base visitor class for processing individual terms in fit terms expressions.

Children should overwrite visitFit_term() to process individual terms, as well as implement the abstract methods.

abstractmethod _end_cross_product_expansion()[source]

Called at the end of processing of a new cross product expansion.

Parameters:

None

Returns:

The terms produced by the cross producc expansion, as generated by the repeated calls to process_cross_product_term().

abstractmethod _end_polynomial_expansion()[source]

Called at the end of processing of a new polynomial expansion.

Parameters:

None

Returns:

The terms produced by the polynomial expansion, as generated by the repeated calls to process_polynomial_term().

abstractmethod _process_cross_product_term(sub_terms)[source]

Called for each term in a cross product expansion.

Parameters:

sub_terms ([]) – A list of the individual terms which must be multiplied together to form a single term in the resulting cross product expansion.

Returns:

None

abstractmethod _process_polynomial_term(input_terms, term_powers)[source]

Called for each term in a polynomial expansion.

Parameters:
  • input_terms ([str]) – The list of terms the polynomial expansion is being performed on.

  • term_Powers ([int]) – The powerlaw indices for each term in input_terms.

Returns:

None

abstractmethod _start_cross_product_expansion(input_term_sets)[source]

Called at the beginning of processing of a new cross product expansion.

Parameters:

input_term_sets ([]) – A list of the sets of terms taking part in the cross product.

Returns:

None

abstractmethod _start_polynomial_expansion(num_output_terms, input_terms_list)[source]

Called at the beginning of processing of a new polynomial expansion.

Parameters:

number_terms (int) – The number of terms the polynomial expansion will produce.

Returns:

None

visitFit_polynomial(ctx: Fit_polynomialContext)[source]

Process the list of terms the polynomial expression expands to.

visitFit_terms_list(ctx: Fit_terms_listContext)[source]

Return a list of the terms in the list.

visitFit_terms_set(ctx: Fit_terms_setContext)[source]

Return a list of the terms in the set.

visitFit_terms_set_cross_product(ctx: Fit_terms_set_cross_productContext)[source]

Return all possible terms combining one term from each input set.