From e1e78d15d7902412467e733fd3749a6191336380 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 6 Aug 2022 02:29:03 -0400 Subject: [PATCH] Get ready for release 5.0.1 Last pass at tweaking language doc to make the PDF render nicer --- CHANGES.rst | 2 +- mathics/builtin/numbers/numbertheory.py | 6 ++--- mathics/builtin/tensors.py | 18 +++++-------- mathics/doc/documentation/1-Manual.mdoc | 12 +++++---- mathics/doc/documentation/A-License.mdoc | 34 +++++++++++++++--------- mathics/doc/tex/Makefile | 4 +-- mathics/doc/tex/doc2latex.py | 6 +++++ mathics/doc/tex/mathics.tex | 3 +++ mathics/doc/tex/sed-hack.sh | 4 ++- mathics/version.py | 2 +- 10 files changed, 54 insertions(+), 37 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5e0ff13ed..94ae1f2f7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -29,7 +29,7 @@ Hyperbolic functions were split off form trigonometry and exponential functions. Bugs ++++ -#. Creating a complex number fom Infinity no longer crashes and returns 'I * Infinity' +#. Creating a complex number from Infinity no longer crashes and returns 'I * Infinity' 5.0.0 ------ diff --git a/mathics/builtin/numbers/numbertheory.py b/mathics/builtin/numbers/numbertheory.py index 1df9e9544..5ff142c83 100644 --- a/mathics/builtin/numbers/numbertheory.py +++ b/mathics/builtin/numbers/numbertheory.py @@ -37,7 +37,7 @@ class ContinuedFraction(SympyFunction): """ - Continued faction. See https://en.wikipedia.org/wiki/Continued_fraction + :Continued fraction: https://en.wikipedia.org/wiki/Continued_fraction (:SymPy: https://docs.sympy.org/latest/modules/ntheory.html#module-sympy.ntheory.continued_fraction, :WMA: https://reference.wolfram.com/language/ref/ContinuedFraction.html)
'ContinuedFraction[$x$, $n$]'
generate the first $n$ terms in the continued fraction representation of $x$. @@ -148,8 +148,8 @@ def apply(self, n, evaluation): class EulerPhi(SympyFunction): """ - Euler's totient function. See https://en.wikipedia.org/wiki/Euler%27s_totient_function - This function counts positive integers up to n that are relatively prime to n. + :Euler's totient function: https://en.wikipedia.org/wiki/Euler%27s_totient_function (:SymPy: https://docs.sympy.org/latest/modules/ntheory.html#sympy.ntheory.factor_.totient, :WMA: https://reference.wolfram.com/language/ref/EulerPhi.html) + This function counts positive integers up to $n$ that are relatively prime to $n$. It is typically used in cryptography and in many applications in elementary number theory.
'EulerPhi[$n$]' diff --git a/mathics/builtin/tensors.py b/mathics/builtin/tensors.py index 2b31b70e4..bbbdc92e2 100644 --- a/mathics/builtin/tensors.py +++ b/mathics/builtin/tensors.py @@ -3,14 +3,11 @@ """ Tensors -In mathematics, a tensor is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space. Objects that tensors may map between include vectors and scalars, and even other tensors. +A :tensor: https://en.wikipedia.org/wiki/Tensor is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space. Objects that tensors may map between include vectors and scalars, and even other tensors. There are many types of tensors, including scalars and vectors (which are the simplest tensors), dual vectors, multilinear maps between vector spaces, and even some operations such as the dot product. Tensors are defined independent of any basis, although they are often referred to by their components in a basis related to a particular coordinate system. Mathics represents tensors of vectors and matrices as lists; tensors of any rank can be handled. - - -See also https://en.wikipedia.org/wiki/Tensor. """ @@ -87,9 +84,8 @@ def get_dimensions(expr, head=None): class ArrayDepth(Builtin): """
-
'ArrayDepth[$a$]' -
returns the depth of the non-ragged array $a$, defined as - 'Length[Dimensions[$a$]]'. +
'ArrayDepth[$a$]' +
returns the depth of the non-ragged array $a$, defined as 'Length[Dimensions[$a$]]'.
>> ArrayDepth[{{a,b},{c,d}}] @@ -335,9 +331,8 @@ def summand(i): class Outer(Builtin): """
-
'Outer[$f$, $x$, $y$]' -
computes a generalised outer product of $x$ and $y$, using - the function $f$ in place of multiplication. +
'Outer[$f$, $x$, $y$]' +
computes a generalised outer product of $x$ and $y$, using the function $f$ in place of multiplication.
>> Outer[f, {a, b}, {1, 2, 3}] @@ -497,7 +492,8 @@ class TranslationTransform(Builtin): class Transpose(Builtin): """ - Transpose. See https://en.wikipedia.org/wiki/Transpose. + :Transpose: https://en.wikipedia.org/wiki/Transpose (:WMA: https://reference.wolfram.com/language/ref/Transpose.html) +
'Tranpose[$m$]'
transposes rows and columns in the matrix $m$. diff --git a/mathics/doc/documentation/1-Manual.mdoc b/mathics/doc/documentation/1-Manual.mdoc index 06f0a6d78..e88a11ee9 100644 --- a/mathics/doc/documentation/1-Manual.mdoc +++ b/mathics/doc/documentation/1-Manual.mdoc @@ -81,7 +81,7 @@ Make sure the builtin summaries and examples clear and useful. - + The following sections are introductions to the basic principles of the language of \Mathics. A few examples and functions are presented. Only their most common usages are listed; for a full description of a Symbols possible arguments, options, etc., see its entry in the Reference of Built-in Symbols. @@ -385,7 +385,7 @@ Lists can be used to assign values to multiple variables at once: >> b = 2 -Many operations, like addition and multiplication, "thread" over lists, i.e. lists are combined element-wise: +Operations like addition and multiplication, "thread" over lists; lists are combined element-wise: >> {1, 2, 3} + {4, 5, 6} = {5, 7, 9} @@ -801,7 +801,7 @@ There are several methods to display expressions in 2-D: >> Subscript[a, 1, 2] // TeXForm = a_{1,2} -If you want even more low-level control of how expressions are displayed, you can override 'MakeBoxes': +If you want even more low-level control over expression display, override 'MakeBoxes': >> MakeBoxes[b, StandardForm] = "c"; >> b @@ -1265,9 +1265,11 @@ This implies that you should not store sensitive, private information in \Mathic If you are using a public terminal, to erase all your definitions and close the browser window. When you use \Mathics in a browser, use the command Quit[] or its alias, Exit[]. -Normally, when you reload the current page in a browser using the default URL, e.g http:localhost:8000, all of the previous input and output disappears, even though definitions as described above do not, unless Quit[] or Exit[] is entered as described above. +When you reload the current page in a browser using the default URL, e.g http:localhost:8000, all of the previous input and output disappears. -However if you want a URL that will that records the input entered the Generate Input Hash button does this. The button looks like this: +On the other hand, Definitions as described above do not, unless Quit[] or Exit[] is entered as described above. + +If you want a URL that will that records the input entered the Generate Input Hash button does this. The button looks like this: diff --git a/mathics/doc/documentation/A-License.mdoc b/mathics/doc/documentation/A-License.mdoc index 360963d3b..08c3dcf6d 100644 --- a/mathics/doc/documentation/A-License.mdoc +++ b/mathics/doc/documentation/A-License.mdoc @@ -215,7 +215,13 @@ Later license versions may give you additional or different permissions. However -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + +SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @@ -238,15 +244,16 @@ If you develop a new program, and you want it to be of the greatest possible use To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. - - Copyright (C) + - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Copyright (C) - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - You should have received a copy of the GNU General Public License along with this program. If not, see . +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see :Licenses: http://www.gnu.org/licenses/. Also add information on how to contact you by electronic and paper mail. @@ -254,17 +261,18 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. + Copyright (C) + +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. -You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/. +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see :Licences: http://www.gnu.org/licenses/. -The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html. +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read :Why you shouldn't use the Lesser GPL for your next library: http://www.gnu.org/philosophy/why-not-lgpl.html. diff --git a/mathics/doc/tex/Makefile b/mathics/doc/tex/Makefile index cacb568ee..0550fd5b4 100644 --- a/mathics/doc/tex/Makefile +++ b/mathics/doc/tex/Makefile @@ -13,7 +13,7 @@ all doc texdoc: mathics.pdf #: Create internal Document Data from .mdoc and Python builtin module docstrings doc-data $(DOC_TEX_DATA_PCL): - (cd ../.. && $(PYTHON) docpipeline.py --output --keep-going --want-sorting) && ./sed-hack.sh + (cd ../.. && $(PYTHON) docpipeline.py --output --keep-going --want-sorting) #: Build mathics PDF mathics.pdf: mathics.tex documentation.tex logo-text-nodrop.pdf logo-heptatom.pdf version-info.tex $(DOC_TEX_DATA_PCL) @@ -21,7 +21,7 @@ mathics.pdf: mathics.tex documentation.tex logo-text-nodrop.pdf logo-heptatom.pd #: File containing version information version-info.tex: doc2latex.py - $(PYTHON) doc2latex.py + $(PYTHON) doc2latex.py && $(BASH) ./sed-hack.sh #: Build test PDF mathics-test.pdf: mathics-test.tex testing.tex diff --git a/mathics/doc/tex/doc2latex.py b/mathics/doc/tex/doc2latex.py index 948621cd4..71755b186 100755 --- a/mathics/doc/tex/doc2latex.py +++ b/mathics/doc/tex/doc2latex.py @@ -11,6 +11,9 @@ import sys from argparse import ArgumentParser +from mpmath import __version__ as mpmathVersion +from numpy import __version__ as NumPyVersion +from sympy import __version__ as SymPyVersion import mathics @@ -75,6 +78,9 @@ def try_cmd(cmd_list: tuple, stdout_or_stderr: str) -> str: versions = { "MathicsCoreVersion": __version__, "PythonVersion": sys.version, + "NumPyVersion": NumPyVersion, + "SymPyVersion": SymPyVersion, + "mpmathVersion": mpmathVersion, } for name, cmd, field in ( diff --git a/mathics/doc/tex/mathics.tex b/mathics/doc/tex/mathics.tex index bf2ba571c..e9570867c 100644 --- a/mathics/doc/tex/mathics.tex +++ b/mathics/doc/tex/mathics.tex @@ -287,6 +287,9 @@ \begin{description} \item[Mathics Core] \hfill \\ \MathicsCoreVersion \item[Python] \hfill \\ \PythonVersion + \item[mpmath] \hfill \\ \mpmathVersion + \item[NumpyPy] \hfill \\ \NumPyVersion + \item[SymPy] \hfill \\ \SymPyVersion \item[XeTeX] \hfill \\ \XeTeXVersion \item[Asymptote] \hfill \\ \AsymptoteVersion \item[Ghostscript] \hfill \\ \GhostscriptVersion diff --git a/mathics/doc/tex/sed-hack.sh b/mathics/doc/tex/sed-hack.sh index 4b07be220..a33347be2 100755 --- a/mathics/doc/tex/sed-hack.sh +++ b/mathics/doc/tex/sed-hack.sh @@ -5,7 +5,9 @@ sed -i -e s/π/\\\\pi/g documentation.tex sed -i -e s/“/\`\`/g documentation.tex sed -i -e s/”/''/g documentation.tex sed -i -e s/”/''/g documentation.tex -sed -i -e s/′/\'/ documentation.tex +sed -i -e s/″/''/g documentation.tex +# sed -i -e s/\\′/'/g documentation.text +#sed -i -e s/′/'/ documentation.tex sed -i -e s/μ/$\\\\mu$/g documentation.tex sed -i -e s/–/--/g documentation.tex sed -i -e s/Φ/$\\\\Phi$/g documentation.tex diff --git a/mathics/version.py b/mathics/version.py index c09f5d5e9..5ed1f6829 100644 --- a/mathics/version.py +++ b/mathics/version.py @@ -5,4 +5,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="5.0.1.dev0" # noqa +__version__="5.0.1" # noqa