1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
%global _empty_manifest_terminate_build 0
Name: python-nrpylatex
Version: 1.3.post1
Release: 1
Summary: LaTeX Interface to SymPy (CAS) for General Relativity
License: BSD License (BSD)
URL: https://github.com/zachetienne/nrpylatex
Source0: https://mirrors.aliyun.com/pypi/web/packages/aa/de/859741f6b9cc873b1830cb28f0f33dd6e3bb0580baf7db31bb3acdd7a2e6/nrpylatex-1.3.post1.tar.gz
BuildArch: noarch
Requires: python3-sympy
%description
[](https://github.com/zachetienne/nrpylatex/actions/workflows/main.yaml)
[](https://pypi.org/project/nrpylatex/)
[](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb)
[](https://arxiv.org/abs/2111.05861)
[NRPy+](https://github.com/zachetienne/nrpytutorial)'s LaTeX Interface to SymPy (CAS) for General Relativity
- automatic expansion of
- [Einstein summation convention](https://en.wikipedia.org/wiki/Einstein_notation)
- Levi-Civita and Christoffel symbols
- Lie and covariant derivatives
- metric inverse and determinant
- automatic index raising and lowering
- arbitrary coordinate system (default)
- exception handling and debugging
## § Installation
To install **NRPyLaTeX** using [PyPI](https://pypi.org/project/nrpylatex/), run the following command in the terminal
$ pip install nrpylatex
## § Exporting (CAS)
If you are using Mathematica instead of SymPy, run the following code to convert your output
from sympy import mathematica_code
namespace = parse_latex(...)
for var in namespace:
exec(f'{var} = mathematica_code({var})')
If you are using a different CAS, reference the SymPy [documentation](https://docs.sympy.org/latest/modules/printing.html) to find the relevant printing function.
## § Interactive Tutorial (MyBinder)
[Quick Start](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb) | [NRPy+ Integration](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-SymPy_LaTeX_Interface.ipynb) | [Guided Example (BSSN Formalism)](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-LaTeX_Interface_Example-BSSN_Cartesian.ipynb)
## § Documentation and Usage
[Getting Started and API Reference](https://zachetienne.github.io/nrpylatex/)
### Simple Example ([Kretschmann Scalar](https://en.wikipedia.org/wiki/Kretschmann_scalar))
**Python REPL or Script (*.py)**
>>> from nrpylatex import parse_latex
>>> parse_latex(r"""
('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
>>> from sympy import simplify
>>> print(simplify(K))
48*G**2*M**2/r**6
**IPython REPL or Jupyter Notebook**
In [1]: %load_ext nrpylatex
In [2]: %%parse_latex
Out[2]: ('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
In [3]: from sympy import simplify
In [4]: print(simplify(K))
Out[4]: 48*G**2*M**2/r**6
%package -n python3-nrpylatex
Summary: LaTeX Interface to SymPy (CAS) for General Relativity
Provides: python-nrpylatex
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-nrpylatex
[](https://github.com/zachetienne/nrpylatex/actions/workflows/main.yaml)
[](https://pypi.org/project/nrpylatex/)
[](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb)
[](https://arxiv.org/abs/2111.05861)
[NRPy+](https://github.com/zachetienne/nrpytutorial)'s LaTeX Interface to SymPy (CAS) for General Relativity
- automatic expansion of
- [Einstein summation convention](https://en.wikipedia.org/wiki/Einstein_notation)
- Levi-Civita and Christoffel symbols
- Lie and covariant derivatives
- metric inverse and determinant
- automatic index raising and lowering
- arbitrary coordinate system (default)
- exception handling and debugging
## § Installation
To install **NRPyLaTeX** using [PyPI](https://pypi.org/project/nrpylatex/), run the following command in the terminal
$ pip install nrpylatex
## § Exporting (CAS)
If you are using Mathematica instead of SymPy, run the following code to convert your output
from sympy import mathematica_code
namespace = parse_latex(...)
for var in namespace:
exec(f'{var} = mathematica_code({var})')
If you are using a different CAS, reference the SymPy [documentation](https://docs.sympy.org/latest/modules/printing.html) to find the relevant printing function.
## § Interactive Tutorial (MyBinder)
[Quick Start](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb) | [NRPy+ Integration](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-SymPy_LaTeX_Interface.ipynb) | [Guided Example (BSSN Formalism)](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-LaTeX_Interface_Example-BSSN_Cartesian.ipynb)
## § Documentation and Usage
[Getting Started and API Reference](https://zachetienne.github.io/nrpylatex/)
### Simple Example ([Kretschmann Scalar](https://en.wikipedia.org/wiki/Kretschmann_scalar))
**Python REPL or Script (*.py)**
>>> from nrpylatex import parse_latex
>>> parse_latex(r"""
('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
>>> from sympy import simplify
>>> print(simplify(K))
48*G**2*M**2/r**6
**IPython REPL or Jupyter Notebook**
In [1]: %load_ext nrpylatex
In [2]: %%parse_latex
Out[2]: ('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
In [3]: from sympy import simplify
In [4]: print(simplify(K))
Out[4]: 48*G**2*M**2/r**6
%package help
Summary: Development documents and examples for nrpylatex
Provides: python3-nrpylatex-doc
%description help
[](https://github.com/zachetienne/nrpylatex/actions/workflows/main.yaml)
[](https://pypi.org/project/nrpylatex/)
[](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb)
[](https://arxiv.org/abs/2111.05861)
[NRPy+](https://github.com/zachetienne/nrpytutorial)'s LaTeX Interface to SymPy (CAS) for General Relativity
- automatic expansion of
- [Einstein summation convention](https://en.wikipedia.org/wiki/Einstein_notation)
- Levi-Civita and Christoffel symbols
- Lie and covariant derivatives
- metric inverse and determinant
- automatic index raising and lowering
- arbitrary coordinate system (default)
- exception handling and debugging
## § Installation
To install **NRPyLaTeX** using [PyPI](https://pypi.org/project/nrpylatex/), run the following command in the terminal
$ pip install nrpylatex
## § Exporting (CAS)
If you are using Mathematica instead of SymPy, run the following code to convert your output
from sympy import mathematica_code
namespace = parse_latex(...)
for var in namespace:
exec(f'{var} = mathematica_code({var})')
If you are using a different CAS, reference the SymPy [documentation](https://docs.sympy.org/latest/modules/printing.html) to find the relevant printing function.
## § Interactive Tutorial (MyBinder)
[Quick Start](https://mybinder.org/v2/gh/zachetienne/nrpylatex.git/HEAD?filepath=docs%2FNRPyLaTeX%20Tutorial.ipynb) | [NRPy+ Integration](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-SymPy_LaTeX_Interface.ipynb) | [Guided Example (BSSN Formalism)](https://mybinder.org/v2/gh/zachetienne/nrpytutorial/HEAD?filepath=Tutorial-LaTeX_Interface_Example-BSSN_Cartesian.ipynb)
## § Documentation and Usage
[Getting Started and API Reference](https://zachetienne.github.io/nrpylatex/)
### Simple Example ([Kretschmann Scalar](https://en.wikipedia.org/wiki/Kretschmann_scalar))
**Python REPL or Script (*.py)**
>>> from nrpylatex import parse_latex
>>> parse_latex(r"""
('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
>>> from sympy import simplify
>>> print(simplify(K))
48*G**2*M**2/r**6
**IPython REPL or Jupyter Notebook**
In [1]: %load_ext nrpylatex
In [2]: %%parse_latex
Out[2]: ('G', 'GammaUDD', 'gDD', 'gUU', 'epsilonUUUU', 'RUDDD', 'K', 'RUUUU', 'M', 'r', 'theta', 'RDDDD', 'gdet')
In [3]: from sympy import simplify
In [4]: print(simplify(K))
Out[4]: 48*G**2*M**2/r**6
%prep
%autosetup -n nrpylatex-1.3.post1
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-nrpylatex -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.post1-1
- Package Spec generated
|