summaryrefslogtreecommitdiff
path: root/python-classroom-gizmos.spec
blob: cc0f02385b370d34ec6be3c2770d3d8ed6f5a3e0 (plain)
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
%global _empty_manifest_terminate_build 0
Name:		python-classroom-gizmos
Version:	0.0b2.dev32
Release:	1
Summary:	Several small functions for classroom instruction.
License:	GNU General Public License v3 or later (GPLv3+)
URL:		https://github.com/Danseur1/Classroom_gizmos
Source0:	https://mirrors.aliyun.com/pypi/web/packages/db/41/0c1a65e979caa9522cecba301bf1b0579bc6ec0de54137e3642a55494ea4/classroom_gizmos-0.0b2.dev32.tar.gz
BuildArch:	noarch


%description
# Classroom Gizmos
This is a collection of functions for classroom instruction in
introductory physics. This is basically using ipython as a calculator
that displays the calculation and the results.<br>
Typical usage to make a set of useful functions available in ipython:

    from classroom_gizmos.handies import *

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
## handies
*_classroom_gizmos.handies_* is a collection of small functions
that are
useful from an ipython prompt. <br>
__Note: Imports from astropy, PyQt5, and func_timeout__<br>
Certain functions and functionality are not available when some of the
imported packages are unavailable.<br>
The **mine()** function lists all the user functions defined
in *_handies.py_*.

### handies defines or imports:
    cdbn(), osname(), getCCode()
    hostname(), call(), rad(), deg(), sinD(), cosD(), tanD(),
    asinD(), acosD(), atanD(), atan2D(), atan2P(), nCr(), comb(),
    pltsize(), select_file(), select_file_timeout(), getTS(), timeStampStr(),
    isInstalled(), randomLetter(), randomElement(), count_down()
    mine()

### Clear screen functions:
    cls  (iPython magic %cls) outputs 23 blank lines.
    clsall() deletes previous text using ascii control character.
Trig Functions in Degrees<br>
&nbsp;&nbsp;&nbsp;&nbsp;'D' and 'P' trig functions work with degrees.<br>
&nbsp;&nbsp;&nbsp;&nbsp;'P' inverse functions return only positive angles.

greeks  &#10230; a string with greek alphabet.<br>
pltsize( w, h, dpi=150) &#10230; resizes plots in matplotlib.<br>
getTS() &#10230; returns a readable time stamp string.<br>
isInstalled( pkgNameStr) &#10230; returns package or None if pkg is not installed.<br>
timeStampStr() &#10230; returns a readable, timestamp string.<br>
From random imports randint and defines randomLetter

mine() &#10230; lists what handies.py defines.
### If PyQt5 package is available defines:
select_file and select_file_timeout
### From math imports these functions:
pi, sqrt, cos, sin, tan, acos, asin, atan, atan2,
degrees, radians, log, log10, exp
### When astropy is available:
Defines nowMJD(); mjd2date(), date2mjd().<br>
Imports astropy.units as "u", i.e. u.cm or u.GHz
### Misc.
The variable 
__IsInteractive__ is True if in interpreter, False if running from command line.<br>
Line magic *cls* is defined, outputs 23 blank lines to 'clear' screen.<<br>
Sets ipython numeric format to %.5g


## jupyter_file_browser
This module implements a file browser that can be used
in a Jupyter Notebook.  (Not usable in Jupyter lab.)<br>
__Typical Usage:__

	from classroom_gizmos.jupyter_file_browser import box, get_file_path
    box

A file select widget will be created below that cell.

In a following notebook cell:

    path = get_file_path()  ## returns path of currently selected file in
    the file select cell.


## import_install
### importInstall()
    pkg = importInstall( 'pkg_name')
    OR
    pkg = importInstall( 'pkg_name, 'PyPI_name')
This function tries to import a specified package and if that fails,
it tries to install the package and then import it.<br>
_*importInstall*_ was written so that python programs can be
distributed to students without detailed instructions on checking if
packages are installed
and information on installing the needed packages.<br>
The function returns the package or None.<br>

**Warning:** _importInstall_ can not install all packages. It is less likely to install a package that is not pure python.

## BestByMinBefore
### functions
decCredit() returns perl code for use in WebAssign answer credit calculations.
Convenience functions:

    BBPdecCredit(), InCdecCredit(),
    HWdecCredit(), getCCode()

<hr>
getCCode() is an interactive 'wizard' that has no parameters, but steps through options needed to 
produce the Perl conditional code for various question types.

All functions should have doc strings that give more information about usage and parameters.





%package -n python3-classroom-gizmos
Summary:	Several small functions for classroom instruction.
Provides:	python-classroom-gizmos
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-classroom-gizmos
# Classroom Gizmos
This is a collection of functions for classroom instruction in
introductory physics. This is basically using ipython as a calculator
that displays the calculation and the results.<br>
Typical usage to make a set of useful functions available in ipython:

    from classroom_gizmos.handies import *

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
## handies
*_classroom_gizmos.handies_* is a collection of small functions
that are
useful from an ipython prompt. <br>
__Note: Imports from astropy, PyQt5, and func_timeout__<br>
Certain functions and functionality are not available when some of the
imported packages are unavailable.<br>
The **mine()** function lists all the user functions defined
in *_handies.py_*.

### handies defines or imports:
    cdbn(), osname(), getCCode()
    hostname(), call(), rad(), deg(), sinD(), cosD(), tanD(),
    asinD(), acosD(), atanD(), atan2D(), atan2P(), nCr(), comb(),
    pltsize(), select_file(), select_file_timeout(), getTS(), timeStampStr(),
    isInstalled(), randomLetter(), randomElement(), count_down()
    mine()

### Clear screen functions:
    cls  (iPython magic %cls) outputs 23 blank lines.
    clsall() deletes previous text using ascii control character.
Trig Functions in Degrees<br>
&nbsp;&nbsp;&nbsp;&nbsp;'D' and 'P' trig functions work with degrees.<br>
&nbsp;&nbsp;&nbsp;&nbsp;'P' inverse functions return only positive angles.

greeks  &#10230; a string with greek alphabet.<br>
pltsize( w, h, dpi=150) &#10230; resizes plots in matplotlib.<br>
getTS() &#10230; returns a readable time stamp string.<br>
isInstalled( pkgNameStr) &#10230; returns package or None if pkg is not installed.<br>
timeStampStr() &#10230; returns a readable, timestamp string.<br>
From random imports randint and defines randomLetter

mine() &#10230; lists what handies.py defines.
### If PyQt5 package is available defines:
select_file and select_file_timeout
### From math imports these functions:
pi, sqrt, cos, sin, tan, acos, asin, atan, atan2,
degrees, radians, log, log10, exp
### When astropy is available:
Defines nowMJD(); mjd2date(), date2mjd().<br>
Imports astropy.units as "u", i.e. u.cm or u.GHz
### Misc.
The variable 
__IsInteractive__ is True if in interpreter, False if running from command line.<br>
Line magic *cls* is defined, outputs 23 blank lines to 'clear' screen.<<br>
Sets ipython numeric format to %.5g


## jupyter_file_browser
This module implements a file browser that can be used
in a Jupyter Notebook.  (Not usable in Jupyter lab.)<br>
__Typical Usage:__

	from classroom_gizmos.jupyter_file_browser import box, get_file_path
    box

A file select widget will be created below that cell.

In a following notebook cell:

    path = get_file_path()  ## returns path of currently selected file in
    the file select cell.


## import_install
### importInstall()
    pkg = importInstall( 'pkg_name')
    OR
    pkg = importInstall( 'pkg_name, 'PyPI_name')
This function tries to import a specified package and if that fails,
it tries to install the package and then import it.<br>
_*importInstall*_ was written so that python programs can be
distributed to students without detailed instructions on checking if
packages are installed
and information on installing the needed packages.<br>
The function returns the package or None.<br>

**Warning:** _importInstall_ can not install all packages. It is less likely to install a package that is not pure python.

## BestByMinBefore
### functions
decCredit() returns perl code for use in WebAssign answer credit calculations.
Convenience functions:

    BBPdecCredit(), InCdecCredit(),
    HWdecCredit(), getCCode()

<hr>
getCCode() is an interactive 'wizard' that has no parameters, but steps through options needed to 
produce the Perl conditional code for various question types.

All functions should have doc strings that give more information about usage and parameters.





%package help
Summary:	Development documents and examples for classroom-gizmos
Provides:	python3-classroom-gizmos-doc
%description help
# Classroom Gizmos
This is a collection of functions for classroom instruction in
introductory physics. This is basically using ipython as a calculator
that displays the calculation and the results.<br>
Typical usage to make a set of useful functions available in ipython:

    from classroom_gizmos.handies import *

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
## handies
*_classroom_gizmos.handies_* is a collection of small functions
that are
useful from an ipython prompt. <br>
__Note: Imports from astropy, PyQt5, and func_timeout__<br>
Certain functions and functionality are not available when some of the
imported packages are unavailable.<br>
The **mine()** function lists all the user functions defined
in *_handies.py_*.

### handies defines or imports:
    cdbn(), osname(), getCCode()
    hostname(), call(), rad(), deg(), sinD(), cosD(), tanD(),
    asinD(), acosD(), atanD(), atan2D(), atan2P(), nCr(), comb(),
    pltsize(), select_file(), select_file_timeout(), getTS(), timeStampStr(),
    isInstalled(), randomLetter(), randomElement(), count_down()
    mine()

### Clear screen functions:
    cls  (iPython magic %cls) outputs 23 blank lines.
    clsall() deletes previous text using ascii control character.
Trig Functions in Degrees<br>
&nbsp;&nbsp;&nbsp;&nbsp;'D' and 'P' trig functions work with degrees.<br>
&nbsp;&nbsp;&nbsp;&nbsp;'P' inverse functions return only positive angles.

greeks  &#10230; a string with greek alphabet.<br>
pltsize( w, h, dpi=150) &#10230; resizes plots in matplotlib.<br>
getTS() &#10230; returns a readable time stamp string.<br>
isInstalled( pkgNameStr) &#10230; returns package or None if pkg is not installed.<br>
timeStampStr() &#10230; returns a readable, timestamp string.<br>
From random imports randint and defines randomLetter

mine() &#10230; lists what handies.py defines.
### If PyQt5 package is available defines:
select_file and select_file_timeout
### From math imports these functions:
pi, sqrt, cos, sin, tan, acos, asin, atan, atan2,
degrees, radians, log, log10, exp
### When astropy is available:
Defines nowMJD(); mjd2date(), date2mjd().<br>
Imports astropy.units as "u", i.e. u.cm or u.GHz
### Misc.
The variable 
__IsInteractive__ is True if in interpreter, False if running from command line.<br>
Line magic *cls* is defined, outputs 23 blank lines to 'clear' screen.<<br>
Sets ipython numeric format to %.5g


## jupyter_file_browser
This module implements a file browser that can be used
in a Jupyter Notebook.  (Not usable in Jupyter lab.)<br>
__Typical Usage:__

	from classroom_gizmos.jupyter_file_browser import box, get_file_path
    box

A file select widget will be created below that cell.

In a following notebook cell:

    path = get_file_path()  ## returns path of currently selected file in
    the file select cell.


## import_install
### importInstall()
    pkg = importInstall( 'pkg_name')
    OR
    pkg = importInstall( 'pkg_name, 'PyPI_name')
This function tries to import a specified package and if that fails,
it tries to install the package and then import it.<br>
_*importInstall*_ was written so that python programs can be
distributed to students without detailed instructions on checking if
packages are installed
and information on installing the needed packages.<br>
The function returns the package or None.<br>

**Warning:** _importInstall_ can not install all packages. It is less likely to install a package that is not pure python.

## BestByMinBefore
### functions
decCredit() returns perl code for use in WebAssign answer credit calculations.
Convenience functions:

    BBPdecCredit(), InCdecCredit(),
    HWdecCredit(), getCCode()

<hr>
getCCode() is an interactive 'wizard' that has no parameters, but steps through options needed to 
produce the Perl conditional code for various question types.

All functions should have doc strings that give more information about usage and parameters.





%prep
%autosetup -n classroom_gizmos-0.0b2.dev32

%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-classroom-gizmos -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Fri Jun 09 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0b2.dev32-1
- Package Spec generated