{"id":15253709,"url":"https://github.com/daquintero/numpsy","last_synced_at":"2025-04-11T14:32:46.899Z","repository":{"id":54920897,"uuid":"327180697","full_name":"daquintero/numpsy","owner":"daquintero","description":"Integration of NumPy, SymPy, SciPy, and Pandas into a single extendable mathematical framework. ","archived":false,"fork":false,"pushed_at":"2023-05-10T19:42:27.000Z","size":692,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T00:06:06.228Z","etag":null,"topics":["integration","numpsy","numpy","pandas","python3","scientific","scipy","sympy"],"latest_commit_sha":null,"homepage":"https://daquintero.github.io/numpsy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daquintero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-06T02:45:51.000Z","updated_at":"2023-05-10T19:41:29.000Z","dependencies_parsed_at":"2023-02-18T14:30:27.225Z","dependency_job_id":"3b0d1e42-6784-4eb6-8a1f-213b038b8531","html_url":"https://github.com/daquintero/numpsy","commit_stats":{"total_commits":65,"total_committers":3,"mean_commits":"21.666666666666668","dds":0.09230769230769231,"last_synced_commit":"b4b38978678a1261c362d7b307bd132bba84b691"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daquintero%2Fnumpsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daquintero%2Fnumpsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daquintero%2Fnumpsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daquintero%2Fnumpsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daquintero","download_url":"https://codeload.github.com/daquintero/numpsy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248419700,"owners_count":21100231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["integration","numpsy","numpy","pandas","python3","scientific","scipy","sympy"],"created_at":"2024-09-29T22:00:49.420Z","updated_at":"2025-04-11T14:32:46.884Z","avatar_url":"https://github.com/daquintero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NumpSy\n\nStraight up mix between NumPy, SymPy and Pandas into a value single-declaration extendable framework to simulatenously perform symbolic and numerical operations.\n\nObjectives:\n1. Ever think you wanted to simultaneously perform numerical and symbolic mathematics for an engineering or optimization derivation? Now you can pretty much intuitively derivate simultaneously whilst performing unit management automatically.\n2. Integrate mathematical analytical derivation Python toolchains into a single handy one that retains and expands each of the constituent packages methods. Retain intuitive compatibility.\n3. Have fun!\n\n### Is it any good?\nI think it's an elegant mathematical representation to simultanously perform symbolic, numerical, and data science operations into a single system. It targets a minimal overhead to raw numpy, sympy or scipy operations.\n\n## Quick Start\n\nDownload the [Anaconda distribution first](https://www.anaconda.com/).\n\nPip install:\n```bash\n$ pip install numpsy\n```\n\nLocal install for most recent version:\n```bash\n$ git clone https://github.com/daquintero/numpsy.git\n$ cd numpsy\n$ python3 setup.py install\n```\n\n## Quick Example\nSee the [10 minutes to NumpSy jupyter notebook](https://github.com/daquintero/numpsy/blob/master/docs/ten_minutes_to_numpsy/10_minutes_to_numpsy.ipynb) for much more.\n\n### Installation\n\n*Import NumpSy*\n\n\n```python\nimport numpsy as nsy\n```\n\n## Units\n\n#### Declare a Unit\n\n\n```python\nmeter = nsy.Unit(name=\"meter\", symbol=\"m\")\nmeter\n```\n\n\n\n\n|                     | Unit                            |\n|:--------------------|:--------------------------------|\n| name                | meter                           |\n| symbol              | \\begin{equation}m\\end{equation} |\n| symbolic_expression | \\begin{equation}Ø\\end{equation} |\n\n\n\n#### Retrieve attributes from this Unit\n\n\n```python\nmeter.s\n```\n\n\n\n\n$\\displaystyle m$\n\n\n\n\n```python\nmeter.symbol\n```\n\n\n\n\n$\\displaystyle m$\n\n\n\n\n```python\nmeter.name\n```\n\n\n\n\n    'meter'\n\n\n\n#### Operate with this unit\n\n\n```python\nfarad_per_meter = nsy.Unit(name=\"Farad\", symbol=\"F\") / meter\nfarad_per_meter\n```\n\n\n\n\n|                     | Unit                                      |\n|:--------------------|:------------------------------------------|\n| name                | (Farad)_per_(meter)                       |\n| symbol              | \\begin{equation}Ø\\end{equation}           |\n| symbolic_expression | \\begin{equation}\\frac{F}{m}\\end{equation} |\n\n\n\n#### Append to Unit Library\n\n\n```python\nnsy.Units().data\n```\n\n\n\n\n    Hertz     Unit       name name_expression               ...\n    Farad     Unit       name name_expression               ...\n    meter     Unit       name name_expression               ...\n    ohm       Unit     name name_expression                 ...\n    ratio     Unit       name name_expression               ...\n    second    Unit        name name_expression              ...\n    Name: 0, dtype: object\n\n\n\n\n```python\nnsy.u\n```\n\n\n\n\n    Hertz     Unit       name name_expression               ...\n    Farad     Unit       name name_expression               ...\n    meter     Unit       name name_expression               ...\n    ohm       Unit     name name_expression                 ...\n    ratio     Unit       name name_expression               ...\n    second    Unit        name name_expression              ...\n    Name: 0, dtype: object\n\n\n\n## Constant\n\n\n```python\ne_0 = nsy.Constant(\n    name=\"permittivity_vaccum\",\n    symbol= \"\\epsilon_0\",\n    numerical=8.8541878128e-12,\n    unit=farad_per_meter\n)\ne_0\n```\n\n\n\n\n|                     | Constant                                                       |\n|:--------------------|:---------------------------------------------------------------|\n| name                | permittivity_vaccum                                            |\n| symbol              | \\begin{equation}\\epsilon_0\\end{equation}                       |\n| symbolic_expression | \\begin{equation}Ø\\end{equation}                                |\n| numerical           | 8.8541878128e-12                                               |\n| unit                | Symbol: \\begin{equation}Ø\\end{equation}                        |\n|                     | Symbolic Expression: \\begin{equation}\\frac{F}{m}\\end{equation} |\n\n\n\n\n```python\ne_0.s\n```\n\n\n\n\n$\\displaystyle \\epsilon_0$\n\n\n\n\n```python\ne_0.n\n```\n\n\n\n\n    8.8541878128e-12\n\n\n\n\n```python\ne_d = nsy.Constant(\n    name=\"dielectric_permittivity\",\n    symbol= \"\\epsilon_d\",\n    numerical=5,\n    unit=nsy.u.ratio\n)\ne_d\n```\n\n\n\n\n|                     | Constant                                             |\n|:--------------------|:-----------------------------------------------------|\n| name                | dielectric_permittivity                              |\n| symbol              | \\begin{equation}\\epsilon_d\\end{equation}             |\n| symbolic_expression | \\begin{equation}Ø\\end{equation}                      |\n| numerical           | 5                                                    |\n| unit                | Symbol: \\begin{equation}\\end{equation}               |\n|                     | Symbolic Expression: \\begin{equation}Ø\\end{equation} |\n\n\n\n#### Constants cannot be mutated\n\n\n```python\ne_d.n = 10\n```\n\n    Constant cannot be mutated. You cannot set any attribute value. Instantiate a new variable.\n\n\n## Variable\n\n\n```python\ncapacitor_plate_separation = nsy.Variable(\n    name=\"capacitor_plate_separation\",\n    symbol= \"d\",\n    numerical=None,\n    unit=nsy.u.meter\n)\ncapacitor_plate_separation\n```\n\n\n\n\n|                     | Variable                                             |\n|:--------------------|:-----------------------------------------------------|\n| name                | capacitor_plate_separation                           |\n| symbol              | \\begin{equation}d\\end{equation}                      |\n| symbolic_expression | \\begin{equation}Ø\\end{equation}                      |\n| numerical           |                                                      |\n| unit                | Symbol: \\begin{equation}m\\end{equation}              |\n|                     | Symbolic Expression: \\begin{equation}Ø\\end{equation} |\n\n\n\n\n```python\ncapacitor_plate_separation.s\n```\n\n\n\n\n$\\displaystyle d$\n\n\n\n\n```python\ncapacitor_plate_separation.u\n```\n\n\n\n\n|                     | Unit                            |\n|:--------------------|:--------------------------------|\n| name                | meter                           |\n| symbol              | \\begin{equation}m\\end{equation} |\n| symbolic_expression | \\begin{equation}Ø\\end{equation} |\n\n\n\n#### Variables can be mutated\n\n\n```python\ncapacitor_plate_separation.n = 1e-6\ncapacitor_plate_separation.n\n```\n\n\n\n\n    1e-06\n\n\n\n\n```python\ncapacitor_plate_separation.numerical = 3e-5\ncapacitor_plate_separation.numerical\n```\n\n\n\n\n    3e-05\n\n\n\n#### Operate between Value objects\nConstants and Variables are value objects.\n\n\n```python\ncapacitance_per_plate_cross_sectional_area = e_d / (e_0 * capacitor_plate_separation)\ncapacitance_per_plate_cross_sectional_area\n```\n\n\n\n\n|                     | Value                                                         |\n|:--------------------|:--------------------------------------------------------------|\n| name                |                                                               |\n| symbol              | \\begin{equation}Ø\\end{equation}                               |\n| symbolic_expression | \\begin{equation}\\frac{\\epsilon_d}{\\epsilon_0 d}\\end{equation} |\n| numerical           | 1.8823484456216984e+16                                        |\n| unit                | Symbol: \\begin{equation}Ø\\end{equation}                       |\n|                     | Symbolic Expression: \\begin{equation}\\frac{}{F}\\end{equation} |\n\n\n\n\n```python\ncapacitance_per_plate_cross_sectional_area.se\n```\n\n\n\n\n$\\displaystyle \\frac{\\epsilon_d}{\\epsilon_0 d}$\n\n\n\n\n```python\ncapacitance_per_plate_cross_sectional_area.n\n```\n\n\n\n\n    1.8823484456216984e+16\n\n\n\n#### Perform Flexible Class Operations\n\n\n```python\nraw_capacitor_cross_sectional_area = (1e-6) ** 2\nraw_capacitor_cross_sectional_area\n```\n\n\n\n\n    1e-12\n\n\n\n\n```python\ndevice_capacitance = capacitance_per_plate_cross_sectional_area * raw_capacitor_cross_sectional_area\ndevice_capacitance\n```\n\n\n\n\n|                     | Value                                                           |\n|:--------------------|:----------------------------------------------------------------|\n| name                |                                                                 |\n| symbol              | \\begin{equation}Ø\\end{equation}                                 |\n| symbolic_expression | \\begin{equation}\\frac{\\epsilon_d Ø}{\\epsilon_0 d}\\end{equation} |\n| numerical           | 18823.484456216982                                              |\n| unit                | Symbol: \\begin{equation}Ø\\end{equation}                         |\n|                     | Symbolic Expression: \\begin{equation}\\frac{Ø}{F}\\end{equation}  |\n\n\n\n\n```python\ndevice_capacitance.name\n```\n\n\n\n\n    ''\n\n\n\n\n```python\ndevice_capacitance.se\n```\n\n\n\n\n$\\displaystyle \\frac{\\epsilon_d Ø}{\\epsilon_0 d}$\n\n\n\n\n```python\ndevice_capacitance.symbol = \"F\"\ndevice_capacitance.symbol\n```\n\n\n\n\n$\\displaystyle F$\n\n\n\n\n```python\nraw_capacitor_cross_sectional_area\n```\n\n\n\n\n    1e-12\n\n\n\n##### Example Functions\n\n\n```python\nnsy.sqrt(device_capacitance)\n```\n\n\n\n\n|                     | Value                                                                 |\n|:--------------------|:----------------------------------------------------------------------|\n| name                |                                                                       |\n| symbol              | \\begin{equation}Ø\\end{equation}                                       |\n| symbolic_expression | \\begin{equation}\\sqrt{F}\\end{equation}                                |\n| numerical           | 137.19870428038664                                                    |\n| unit                | Symbol: \\begin{equation}Ø\\end{equation}                               |\n|                     | Symbolic Expression: \\begin{equation}\\sqrt{\\frac{Ø}{F}}\\end{equation} |\n\n\n\n\n```python\nnsy.sinh(device_capacitance)\n```\n\n\n\n\n\n|                     | Value                                                                 |\n|:--------------------|:----------------------------------------------------------------------|\n| name                |                                                                       |\n| symbol              | \\begin{equation}Ø\\end{equation}                                       |\n| symbolic_expression | \\begin{equation}\\sinh{\\left(F \\right)}\\end{equation}                  |\n| numerical           | inf                                                                   |\n| unit                | Symbol: \\begin{equation}Ø\\end{equation}                               |\n|                     | Symbolic Expression: \\begin{equation}\\sqrt{\\frac{Ø}{F}}\\end{equation} |\n\n\n\n\n### Future plans\n* Extend unit management and verification.\n* Create a full constants list, probably even in Excel or as an importable CSV file into Pandas.\n\nOpen to contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaquintero%2Fnumpsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaquintero%2Fnumpsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaquintero%2Fnumpsy/lists"}