https://github.com/pythonnut/sage-config
:symbols: My SAGEmath configuration
https://github.com/pythonnut/sage-config
Last synced: about 1 month ago
JSON representation
:symbols: My SAGEmath configuration
- Host: GitHub
- URL: https://github.com/pythonnut/sage-config
- Owner: PythonNut
- Created: 2014-09-11T22:48:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-02-19T23:57:13.000Z (about 3 years ago)
- Last Synced: 2025-02-07T08:49:00.351Z (3 months ago)
- Language: Sage
- Homepage:
- Size: 146 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sage-config
===========My SAGEmath configuration, in which I introduce the object `S` and all of its superpowers.
This code is here for a single purpose: to help me solve simple technical problem faster. How much DWIM is too much? How much type-instability and ambiguity is too much? Do you like puns? `S` contains many. But rather than talking, let me demonstrate.
```python
# Split a string into pairs, merge the pairs, cast to int, and discard below 50
sage: S(+S, int, S>50, S.chunks("22637406234619207234", 2))
[63, 74, 72]
# Solve an expression for zero or an equation
sage: S(S.sv, [x^2 + 3*x, sqrt(x) == 9])
[[x == -3, x == 0], [x == 81]]
# Parallel expression substitution
sage: S(x^2 + y^4, [x^2 == 3, y^2 == 5])
28
# Function composition
sage: S(bin, str, S.upper)(90)
'0B1011010'
# Cast an expression into a function
sage: S[sqrt(x) + x^2](9)
84
# Convenient access to numpy, sympy, scipy, mpl, etc.
sage: S.norm(S.r_[1:10])
16.881943016134134
# Syntax-free lambdas
sage: (S^2 + S/2)(8)
68
```For the gory details, please consult [the wiki](https://github.com/PythonNut/sage-config/wiki).
Installation
============
```bash
cd ~/.sage
git init
git remote add origin [email protected]:PythonNut/sage-config.git
git fetch -a
git reset origin/master
git checkout -t origin/master
```