Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples? #6

Closed
jimlynnjulian opened this issue Nov 1, 2017 · 4 comments
Closed

Examples? #6

jimlynnjulian opened this issue Nov 1, 2017 · 4 comments

Comments

@jimlynnjulian
Copy link

Hello,

Thank you for your software.
I could slog through the API, but I have only two long astronomy formulas to convert from excel to python.
A couple of examples would help new users.

@jimlynnjulian
Copy link
Author

I decided to slog through the translation.

@vinci1it2000
Copy link
Owner

vinci1it2000 commented Nov 14, 2017

An example how to parse and execute an excel formula is the following:

    >>> import formulas
    >>> func = formulas.Parser().ast('=(1 + 1) + (A1 + B3) / A2')[1].compile()

To visualize formula model and get the input order you can do the following:

   >>> func.inputs
   OrderedDict([('A1', <Ranges>(A1)), ('A2', <Ranges>(A2)), ('B3', <Ranges>(B3))])
   >>> func.plot()

image

Finally to execute the formula and plot the workflow:

   >>> func(0, 1, 5)
   7.0
   >>> func.plot(workflow=True)

image

vinci1it2000 added a commit that referenced this issue Jul 19, 2018
vinci1it2000 added a commit that referenced this issue Jul 19, 2018
vinci1it2000 added a commit that referenced this issue Jul 19, 2018
vinci1it2000 added a commit that referenced this issue Jul 19, 2018
vinci1it2000 added a commit that referenced this issue Jul 20, 2018
@vinci1it2000
Copy link
Owner

Some basic example has been added to the documentation.

@jimlynnjulian
Copy link
Author

I'm sure the exa,mples will be very helpful. Thank you.
J.L.J.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants