Skip to main content

GYM CAS

PyPI - Version PyPI - Python Version Coverage

Anvend Python som CAS (Computational Algebra System) i gymnasiet. Bygger på følgende moduler:

Udvikling

  1. Install uv
  2. Install tox: uv tool install tox --with tox-uv
  3. Create local virtual environment: uv venv
  • Run only tests (directly with uv): uv run pytest tests
  • Run tests, coverage, lint, typecheck with tox (uv backend): tox
  • Run venv: uv run python

Publish with uv

  1. Setup PYPI token (powershell)
[System.Environment]::SetEnvironmentVariable("UV_PUBLISH_TOKEN", "pypi-...", "User")
$env:UV_PUBLISH_TOKEN = "pypi-..."
  1. Publish with: uv publish

Installation

pip install gym-cas

eller

py -m pip install gym-cas

Cheatsheet

I nedenstående afsnit antages det at gym_cas først importeres således:

from gym_cas import *

B1. Tal- og bogstavregning

expand( udtryk )
factor( udtryk )

B2. Ligninger og uligheder

solve( udtryk )
solve( [udtryk1, udtryk2] )
nsolve( udtryk, startgæt )
solve_interval( udtryk, start, slut )

Opstille ligning

For at opstille en ligning kan man enten omforme sin ligning så en af siderne er lig 0 (og udelade 0) eller bruge Eq.

Ligningen x/2 = 10 kan skrives som x/2-10 eller som Eq(x/2, 10).

Ligningsløsning ved solve(x/2-10) eller solve(Eq(x/2, 10)) giver samme resultat.

B3. Geometri og trigonometri

Sin( vinkel )
Cos( vinkel )
Tan( vinkel )
aSin( forhold )
aCos( forhold )
aTan( forhold )

B4. Analytisk plangeometri

plot_points( X_list ,Y_list)
plot( funktion )
plot_implicit( udtryk ,xlim=( x_min, x_max),ylim=( y_min, y_max))
plot_geometry( Geometrisk objekt )

Flere grafer i en afbildning

p1 = plot( udtryk1 )
p2 = plot( udtryk2 )
p = p1 + p2
p.show()

B5. Vektorer

a = vector(x,y)
a.dot(b)
plot_vector( vektor )
plot_vector( start, vektor )
plot_vector( [vektor1, vektor2, ...])

B6. Deskriptiv Statistik

Ugrupperet

max( data )
min( data )
mean( data )
median( data )
var( data, ddof )
std( data, ddof ) 
kvartiler( data )
percentile( data , procenter )
frekvenstabel( data )
boxplot( data ) 
plot_sum( data )

Grupperet

group_mean( data, grupper )
group_percentile( data, grupper, procenter )
group_var( data, grupper, ddof )
group_std( data, grupper, ddof ) 
frekvenstabel( data, grupper )
boxplot( data, grupper ) 
plot_sum( data, grupper )
plot_hist( data, grupper )

B8. Funktioner

def f(x):
    return funktionsudtryk
f(3)

def f(x):
    return Piecewise(( funktion1, betingelse1), (funktion2, betingelse2)) # Betingelser kan sammensættes med &

plot( funktion , yscale="log")
plot( funktion , (variabel, start, stop), xscale="log", yscale="log")
regression_poly(X,Y, grad)
regression_power(X,Y)
regression_exp(X,Y)

B9. Differentialregning

limit( udtryk, variabel, grænse, retning )
diff( funktion )
def df(xi):
    return diff( funktion ).subs( variabel, xi )

B10. Integralregning

integrate( udtryk )
integrate( udtryk, ( variabel, start, slut ))
plot3d_revolution( udtryk , (x, a, b),parallel_axis="x")

A1. Vektorer i rummet

a = vector(1,2,3)
a.cross(b)
plot_vector( a )
plot3d_points( X, Y, Z )
plot3d_line( a + t * r )
plot3d_plane( a + s * r1 + t * r2 )
plot3d_plane( ligning, (x, x_min, x_max), (y, y_min, y_max), (z, z_min, z_max) )
plot3d_sphere( radius, centrum )
plot3d_implicit( ligning, backend=PB ) # Kræver Plotly eller K3D

A4. Differentialligninger

f = Function('f')
dsolve( ode )
plot_ode( ode, (x, start, stop), (f, start, stop))

A5. Diskret Matematik

X = [ udregning for x in range(start,slut)]
X = [ startbetingelse ]
for i in range(start, slut):
    X.append( rekursionsligning )

Metadata

Release files for gym-cas 1.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gym-cas 1.1.8
File Size Uploaded Provenance Actions
gym_cas-1.1.8.tar.gz 37.9 kB Without provenance Details for gym_cas-1.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gym-cas 1.1.8
File Interpreter ABI Platform Actions
gym_cas-1.1.8-py3-none-any.whl Python 3 none any Details for gym_cas-1.1.8-py3-none-any.whl

Total release size: 62.8 kB

Release files / gym_cas-1.1.8.tar.gz

Download URL gym_cas-1.1.8.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a34c994a72c47be46d9ac0d3fe83961cd11ed4194dc53ed21fdf2de6de865b8d
BLAKE2b-256 checksum
How to use checksums
e9e7ad85995e706458211feca8ce31caf192ddd56b062c8612d458a49639a5d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gym_cas-1.1.8-py3-none-any.whl

Download URL gym_cas-1.1.8-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79664197095d3bbe7692050674b31ef8020820478227533a47283fb1edc39a13
BLAKE2b-256 checksum
How to use checksums
aad5c10089ca58d4dd185932742c201bc576ca7c6289b15bd0a0c3e90b8bc7f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gym-cas 1.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.8 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page