Skip to content

Commit

Permalink
Get ready for release 5.0.1
Browse files Browse the repository at this point in the history
Last pass at tweaking language doc to make the PDF render nicer
  • Loading branch information
rocky committed Aug 6, 2022
1 parent fc284ba commit e1e78d1
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------
Expand Down
6 changes: 3 additions & 3 deletions mathics/builtin/numbers/numbertheory.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

class ContinuedFraction(SympyFunction):
"""
Continued faction. See <url>https://en.wikipedia.org/wiki/Continued_fraction</url>
<url>:Continued fraction: https://en.wikipedia.org/wiki/Continued_fraction</url> (<url>:SymPy: https://docs.sympy.org/latest/modules/ntheory.html#module-sympy.ntheory.continued_fraction</url>, <url>:WMA: https://reference.wolfram.com/language/ref/ContinuedFraction.html</url>)
<dl>
<dt>'ContinuedFraction[$x$, $n$]'
<dd>generate the first $n$ terms in the continued fraction representation of $x$.
Expand Down Expand Up @@ -148,8 +148,8 @@ def apply(self, n, evaluation):

class EulerPhi(SympyFunction):
"""
Euler's totient function. See <url>https://en.wikipedia.org/wiki/Euler%27s_totient_function</url>
This function counts positive integers up to n that are relatively prime to n.
<url>:Euler's totient function: https://en.wikipedia.org/wiki/Euler%27s_totient_function</url> (<url>:SymPy: https://docs.sympy.org/latest/modules/ntheory.html#sympy.ntheory.factor_.totient</url>, <url>:WMA: https://reference.wolfram.com/language/ref/EulerPhi.html</url>)
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.
<dl>
<dt>'EulerPhi[$n$]'
Expand Down
18 changes: 7 additions & 11 deletions mathics/builtin/tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>:tensor: https://en.wikipedia.org/wiki/Tensor</url> 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 <url>https://en.wikipedia.org/wiki/Tensor</url>.
"""


Expand Down Expand Up @@ -87,9 +84,8 @@ def get_dimensions(expr, head=None):
class ArrayDepth(Builtin):
"""
<dl>
<dt>'ArrayDepth[$a$]'
<dd>returns the depth of the non-ragged array $a$, defined as
'Length[Dimensions[$a$]]'.
<dt>'ArrayDepth[$a$]'
<dd>returns the depth of the non-ragged array $a$, defined as 'Length[Dimensions[$a$]]'.
</dl>
>> ArrayDepth[{{a,b},{c,d}}]
Expand Down Expand Up @@ -335,9 +331,8 @@ def summand(i):
class Outer(Builtin):
"""
<dl>
<dt>'Outer[$f$, $x$, $y$]'
<dd>computes a generalised outer product of $x$ and $y$, using
the function $f$ in place of multiplication.
<dt>'Outer[$f$, $x$, $y$]'
<dd>computes a generalised outer product of $x$ and $y$, using the function $f$ in place of multiplication.
</dl>
>> Outer[f, {a, b}, {1, 2, 3}]
Expand Down Expand Up @@ -497,7 +492,8 @@ class TranslationTransform(Builtin):

class Transpose(Builtin):
"""
Transpose. See <url>https://en.wikipedia.org/wiki/Transpose</url>.
<url>:Transpose: https://en.wikipedia.org/wiki/Transpose</url> (<url>:WMA: https://reference.wolfram.com/language/ref/Transpose.html</url>)
<dl>
<dt>'Tranpose[$m$]'
<dd>transposes rows and columns in the matrix $m$.
Expand Down
12 changes: 7 additions & 5 deletions mathics/doc/documentation/1-Manual.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Make sure the builtin summaries and examples clear and useful.</li>
</chapter>


<chapter title="Language Tutorials">
<chapter title="Language Tutorial">

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.

Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <con>Quit[]</con> or its alias, <con>Exit[]</con>.

Normally, when you reload the current page in a browser using the default URL, e.g <con>http:localhost:8000</con>, all of the previous input and output disappears, even though definitions as described above do not, unless <con>Quit[]</con> or <con>Exit[]</con> is entered as described above.
When you reload the current page in a browser using the default URL, e.g <con>http:localhost:8000</con>, all of the previous input and output disappears.

However if you want a URL that will that records the input entered the <em>Generate Input Hash</em> button does this. The button looks like this:
On the other hand, Definitions as described above do not, unless <con>Quit[]</con> or <con>Exit[]</con> is entered as described above.

If you want a URL that will that records the input entered the <em>Generate Input Hash</em> button does this. The button looks like this:

<imgpng src="generate-hash-button.png" title="Mathics Generate Input Hash Button" label="generate-input-hash-button">

Expand Down
34 changes: 21 additions & 13 deletions mathics/doc/documentation/A-License.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ Later license versions may give you additional or different permissions. However
</subsection>

<subsection title="15. Disclaimer of Warranty.">
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.

</subsection>

Expand All @@ -238,33 +244,35 @@ 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.

<console>
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
<one line to give the program's name and a brief idea of what it does.>

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) <year> <name of author>

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 <http://www.gnu.org/licenses/>.
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 <url>:Licenses: http://www.gnu.org/licenses/</url>.
</console>

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:

<console>
<program> Copyright (C) <year> <name of author>
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.
<program> Copyright (C) <year> <name of author>

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.
</console>

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 <url>http://www.gnu.org/licenses/</url>.
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 <url>:Licences: http://www.gnu.org/licenses/</url>.

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 <url>http://www.gnu.org/philosophy/why-not-lgpl.html</url>.
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 <url>:Why you shouldn't use the Lesser GPL for your next library: http://www.gnu.org/philosophy/why-not-lgpl.html</url>.

</section>

Expand Down
4 changes: 2 additions & 2 deletions mathics/doc/tex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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)
$(LATEXMK) --verbose -f -pdf -pdflatex="$(XETEX) -halt-on-error" mathics

#: 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
Expand Down
6 changes: 6 additions & 0 deletions mathics/doc/tex/doc2latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 (
Expand Down
3 changes: 3 additions & 0 deletions mathics/doc/tex/mathics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion mathics/doc/tex/sed-hack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mathics/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e1e78d1

Please sign in to comment.