Skip to content

Start builtins hierarchy#1323

Merged
rocky merged 2 commits intomasterfrom
builtin-submodules-small
Apr 27, 2021
Merged

Start builtins hierarchy#1323
rocky merged 2 commits intomasterfrom
builtin-submodules-small

Conversation

@rocky
Copy link
Copy Markdown
Member

@rocky rocky commented Apr 26, 2021

We can now nest builtins within a broader module.
For example under, "Special Functions" we can have "Orthogonal
Polynomials" and "Bessel Functions".

@rocky rocky requested a review from mmatera April 26, 2021 20:54
@mmatera
Copy link
Copy Markdown
Contributor

mmatera commented Apr 27, 2021

@rocky, this and PR #1321 are covering the same? Or are independent?

@rocky
Copy link
Copy Markdown
Member Author

rocky commented Apr 27, 2021

@rocky, this and PR #1321 are covering the same? Or are independent?

#1321 was too ambitious. So this is the first commit from that. I'd like this to go in. And then I'll break up the remainder into a couple of smaller chunks.

@rocky rocky force-pushed the builtin-submodules-small branch 2 times, most recently from b0f3e8b to 0fe0cc4 Compare April 27, 2021 01:12
We can now nest builtins within a broader module.
For example under, "Special Functions" we can have "Orthogonal
Polynomials" and "Bessel Functions".
@rocky rocky force-pushed the builtin-submodules-small branch 4 times, most recently from 354b5c4 to 8c58a00 Compare April 27, 2021 11:25
Make __init__.py less odd. Segregte main-line code at the bottom
and separate it from the functions. Probably it should go outside
of __init__ altogether. Reduce globing for files in favor of the
(awkard) Pythonic way.
@rocky rocky force-pushed the builtin-submodules-small branch from 8c58a00 to 118e912 Compare April 27, 2021 12:02
@rocky
Copy link
Copy Markdown
Member Author

rocky commented Apr 27, 2021

@mmatera Now that this passes CI, I'd like to merge this into master so we can build off of this. Thoughts?

@mmatera
Copy link
Copy Markdown
Contributor

mmatera commented Apr 27, 2021

Before merging, we should check first if these changes do not break the pymathics loading mechanism.

@rocky
Copy link
Copy Markdown
Member Author

rocky commented Apr 27, 2021

Before merging, we should check first if these changes do not break the pymathics loading mechanism.

Hmmm. It does break! I will investigate this later.

What is the special thing that is going on there that you thought to mention it?

@mmatera
Copy link
Copy Markdown
Contributor

mmatera commented Apr 27, 2021

Just because of a couple of functions in builtin.init and builtin.base are called in pymathics_load_module, and it is something that we do not check in CI...

@rocky
Copy link
Copy Markdown
Member Author

rocky commented Apr 27, 2021

Just because of a couple of functions in builtin.init and builtin.base are called in pymathics_load_module, and it is something that we do not check in CI...

I spoke to soon when I said things weren't working. They still are. I had just upgraded my Python and didn't install install the pymathics modules. See below.

In the long term though the way to check this is from another project. For example mathics-omnibus which already builds a number of the more stable pymathics modules.

$ python ./setup.py develop
running develop
running egg_info
writing Mathics3.egg-info/PKG-INFO
writing dependency_links to Mathics3.egg-info/dependency_links.txt
writing entry points to Mathics3.egg-info/entry_points.txt
writing requirements to Mathics3.egg-info/requires.txt
writing top-level names to Mathics3.egg-info/top_level.txt
reading manifest file 'Mathics3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'mathics/Makefile'
writing manifest file 'Mathics3.egg-info/SOURCES.txt'
running build_ext
skipping 'mathics/core/expression.c' Cython extension (up-to-date)
skipping 'mathics/core/numbers.c' Cython extension (up-to-date)
...
skipping 'mathics/builtin/graphics.c' Cython extension (up-to-date)
Creating /home/rocky/.pyenv/versions/3.7.10/lib/python3.7/site-packages/Mathics3.egg-link (link to .)
Mathics3 2.1.1.dev0 is already the active version in easy-install.pth
Installing mathics script to /home/rocky/.pyenv/versions/3.7.10/bin

Installed /src/external-vcs/github/mathics/Mathics
Processing dependencies for Mathics3==2.1.1.dev0
...
Best match: zipp 3.4.0
Adding zipp 3.4.0 to easy-install.pth file

Using /home/rocky/.pyenv/versions/3.7.10/lib/python3.7/site-packages
Finished processing dependencies for Mathics3==2.1.1.dev0
08:43:27 [builtin-submodules-small] rocky@muffin:/src/external-vcs/github/mathics/Mathics [1,0,b] 0
$ mathics

Mathics 2.1.1.dev0
on CPython 3.7.10 (default, Feb 23 2021, 10:13:46) 
using SymPy 1.7.1, mpmath 1.2.1, numpy 1.20.2, cython 0.29.22

Copyright (C) 2011-2021 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:= LoadModule["pymathics.natlang"]
Out[1]= pymathics.natlang

In[2]:= Pluralize["try"]
Out[2]= tries

@mmatera
Copy link
Copy Markdown
Contributor

mmatera commented Apr 27, 2021

Excellent! Then, go ahead with merging!

@rocky
Copy link
Copy Markdown
Member Author

rocky commented Apr 27, 2021

Excellent! Then, go ahead with merging!

Thanks for your patience, tolerance and guidance!

@rocky rocky merged commit 1abd6d1 into master Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants