Skip to content

docs: Tutorial is faulty in User Guide / Experiment Runners / Synthetic / Example / Equation Sampling #706

@LJKS

Description

@LJKS

Description:

The tutorial under User Guide / Experiment Runners / Synthetic / Example / Equation Sampling (at https://autoresearch.github.io/autora/abstract-equation/docs/Equation%20Sampler/) seems faulty:

It includes the line of code:

from equation_sampler import sample_equations, to_sympy

resulting in the error message:

from equation_sampler import sample_equations, to_sympy

ImportError: cannot import name 'to_sympy' from 'equation_sampler' (LOCAL_PATH/anaconda3/envs/aerloop/lib/python3.12/site-packages/equation_sampler/__init__.py)

Explanation:

Looking into the linked github for the autora equation sampler (notice the tutorial refers to this, but the readme is currently a default stub) (https://github.com/AutoResearch/equation-sampler) provides the following information to me:

In the respective code (https://github.com/AutoResearch/equation-sampler/blob/main/src/equation_sampler/__init__.py) , lines 1-3 include the only imports for the package equation_sampler:

from .sampler import sample_equations

sample = sample_equations

These lines make sample and sample_equations available as respective aliases to the same function call.
Further inspecting the code code linked here, i.e. (https://github.com/AutoResearch/equation-sampler/blob/main/src/equation_sampler/sampler.py):

The relevant function sample_equations is defined in line 126. On lines 375-379 it returns a dictionary including the equations, sympy-equations and evaluations:

    return {
        "tokenized_equations": tokenized_equation_list,
        "sympy_equations": sympy_equation_list,
        "evaluations": evaluation_list,
    }

I assume the tutorial was written for an old version of the equation sampler sub-package, as multiple changes there refer potentially temporary changes for an autoencoder-project.

System Info:
Irrelevant, as I confirmed it on the colab notebook linked in the tutorial.

Proposed fix:

sympy_equations = equations['sympy_equations']
expr = sympy_equations[0]

Adjust the tutorial respectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions