Commit 781c904c authored by Jun Siang Cheah's avatar Jun Siang Cheah
Browse files

refac: fetch pyodide deps at build time, not checked into git

parent 3aa6b0fe
...@@ -16,6 +16,10 @@ __pycache__/ ...@@ -16,6 +16,10 @@ __pycache__/
# C extensions # C extensions
*.so *.so
# Pyodide distribution
static/pyodide/*
!static/pyodide/pyodide-lock.json
# Distribution / packaging # Distribution / packaging
.Python .Python
build/ build/
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
"version": "0.1.124", "version": "0.1.124",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev --host", "dev": "npm run pyodide:fetch && vite dev --host",
"build": "vite build", "build": "npm run pyodide:fetch && vite build",
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
"format:backend": "black . --exclude \"/venv/\"", "format:backend": "black . --exclude \"/venv/\"",
"i18n:parse": "i18next --config i18next-parser.config.ts && prettier --write \"src/lib/i18n/**/*.{js,json}\"", "i18n:parse": "i18next --config i18next-parser.config.ts && prettier --write \"src/lib/i18n/**/*.{js,json}\"",
"cy:open": "cypress open", "cy:open": "cypress open",
"test:frontend": "vitest" "test:frontend": "vitest",
"pyodide:fetch": "node scripts/prepare-pyodide.js"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.0.0",
......
mkdir -p ./static/pyodide
cp ./node_modules/pyodide/pyodide* ./static/pyodide/
cp ./node_modules/pyodide/python_stdlib.zip ./static/pyodide/
\ No newline at end of file
const packages = ['requests', 'beautifulsoup4', 'numpy', 'pandas', 'matplotlib'];
import { loadPyodide } from 'pyodide';
import { writeFile, copyFile, readdir } from 'fs/promises';
async function downloadPackages() {
console.log('Setting up pyodide + micropip');
const pyodide = await loadPyodide({
packageCacheDir: 'static/pyodide'
});
await pyodide.loadPackage('micropip');
const micropip = pyodide.pyimport('micropip');
console.log('Downloading Pyodide packages:', packages);
await micropip.install(packages);
console.log('Pyodide packages downloaded, freezing into lock file');
const lockFile = await micropip.freeze();
await writeFile('static/pyodide/pyodide-lock.json', lockFile);
}
async function copyPyodide() {
console.log('Copying Pyodide files into static directory');
// Copy all files from node_modules/pyodide to static/pyodide
for await (const entry of await readdir('node_modules/pyodide')) {
await copyFile(`node_modules/pyodide/${entry}`, `static/pyodide/${entry}`);
}
}
await downloadPackages();
await copyPyodide();
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'highlight.js/styles/github-dark.min.css'; import 'highlight.js/styles/github-dark.min.css';
import { loadPyodide } from 'pyodide'; import { loadPyodide } from 'pyodide';
import { tick } from 'svelte'; import { tick } from 'svelte';
import PyodideWorker from '../../../workers/pyodide.worker?worker';
export let id = ''; export let id = '';
...@@ -168,13 +169,11 @@ ...@@ -168,13 +169,11 @@
} else { } else {
stderr = `${text}\n`; stderr = `${text}\n`;
} }
} },
packages: ['micropip']
}); });
try { try {
const res = await pyodide.loadPackage('micropip');
console.log(res);
const micropip = pyodide.pyimport('micropip'); const micropip = pyodide.pyimport('micropip');
await micropip.set_index_urls('https://pypi.org/pypi/{package_name}/json'); await micropip.set_index_urls('https://pypi.org/pypi/{package_name}/json');
...@@ -234,7 +233,7 @@ __builtins__.input = input`); ...@@ -234,7 +233,7 @@ __builtins__.input = input`);
code.includes('matplotlib') ? 'matplotlib' : null code.includes('matplotlib') ? 'matplotlib' : null
].filter(Boolean); ].filter(Boolean);
const pyodideWorker = new Worker('/pyodide-worker.js'); const pyodideWorker = new PyodideWorker();
pyodideWorker.postMessage({ pyodideWorker.postMessage({
id: id, id: id,
......
// webworker.js import { loadPyodide, type PyodideInterface } from 'pyodide';
// Setup your project to serve `py-worker.js`. You should also serve
// `pyodide.js`, and all its associated `.asm.js`, `.json`,
// and `.wasm` files as well:
importScripts('/pyodide/pyodide.js');
async function loadPyodideAndPackages(packages = []) { declare global {
interface Window {
stdout: string | null;
stderr: string | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result: any;
pyodide: PyodideInterface;
packages: string[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
}
async function loadPyodideAndPackages(packages: string[] = []) {
self.stdout = null; self.stdout = null;
self.stderr = null; self.stderr = null;
self.result = null; self.result = null;
...@@ -21,16 +30,16 @@ async function loadPyodideAndPackages(packages = []) { ...@@ -21,16 +30,16 @@ async function loadPyodideAndPackages(packages = []) {
} }
}, },
stderr: (text) => { stderr: (text) => {
console.log('An error occured:', text); console.log('An error occurred:', text);
if (self.stderr) { if (self.stderr) {
self.stderr += `${text}\n`; self.stderr += `${text}\n`;
} else { } else {
self.stderr = `${text}\n`; self.stderr = `${text}\n`;
} }
} },
packages: ['micropip']
}); });
await self.pyodide.loadPackage('micropip');
const micropip = self.pyodide.pyimport('micropip'); const micropip = self.pyodide.pyimport('micropip');
await micropip.set_index_urls('https://pypi.org/pypi/{package_name}/json'); await micropip.set_index_urls('https://pypi.org/pypi/{package_name}/json');
...@@ -40,7 +49,7 @@ async function loadPyodideAndPackages(packages = []) { ...@@ -40,7 +49,7 @@ async function loadPyodideAndPackages(packages = []) {
self.onmessage = async (event) => { self.onmessage = async (event) => {
const { id, code, ...context } = event.data; const { id, code, ...context } = event.data;
console.log(event.data) console.log(event.data);
// The worker copies the context in its own "memory" (an object mapping name to values) // The worker copies the context in its own "memory" (an object mapping name to values)
for (const key of Object.keys(context)) { for (const key of Object.keys(context)) {
...@@ -53,3 +62,5 @@ self.onmessage = async (event) => { ...@@ -53,3 +62,5 @@ self.onmessage = async (event) => {
self.result = await self.pyodide.runPythonAsync(code); self.result = await self.pyodide.runPythonAsync(code);
self.postMessage({ id, result: self.result, stdout: self.stdout, stderr: self.stderr }); self.postMessage({ id, result: self.result, stdout: self.stdout, stderr: self.stderr });
}; };
export default {};
Metadata-Version: 2.1
Name: cycler
Version: 0.12.1
Summary: Composable style cycles
Author-email: Thomas A Caswell <matplotlib-users@python.org>
License: Copyright (c) 2015, matplotlib project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the matplotlib project nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: homepage, https://matplotlib.org/cycler/
Project-URL: repository, https://github.com/matplotlib/cycler
Keywords: cycle kwargs
Classifier: License :: OSI Approved :: BSD License
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: docs
Requires-Dist: ipython ; extra == 'docs'
Requires-Dist: matplotlib ; extra == 'docs'
Requires-Dist: numpydoc ; extra == 'docs'
Requires-Dist: sphinx ; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: pytest-xdist ; extra == 'tests'
|PyPi|_ |Conda|_ |Supported Python versions|_ |GitHub Actions|_ |Codecov|_
.. |PyPi| image:: https://img.shields.io/pypi/v/cycler.svg?style=flat
.. _PyPi: https://pypi.python.org/pypi/cycler
.. |Conda| image:: https://img.shields.io/conda/v/conda-forge/cycler
.. _Conda: https://anaconda.org/conda-forge/cycler
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/cycler.svg
.. _Supported Python versions: https://pypi.python.org/pypi/cycler
.. |GitHub Actions| image:: https://github.com/matplotlib/cycler/actions/workflows/tests.yml/badge.svg
.. _GitHub Actions: https://github.com/matplotlib/cycler/actions
.. |Codecov| image:: https://codecov.io/github/matplotlib/cycler/badge.svg?branch=main&service=github
.. _Codecov: https://codecov.io/github/matplotlib/cycler?branch=main
cycler: composable cycles
=========================
Docs: https://matplotlib.org/cycler/
Metadata-Version: 2.1
Name: kiwisolver
Version: 1.4.5
Summary: A fast implementation of the Cassowary constraint solver
Author-email: The Nucleic Development Team <sccolbert@gmail.com>
Maintainer-email: "Matthieu C. Dartiailh" <m.dartiailh@gmail.com>
License: =========================
The Kiwi licensing terms
=========================
Kiwi is licensed under the terms of the Modified BSD License (also known as
New or Revised BSD), as follows:
Copyright (c) 2013, Nucleic Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of the Nucleic Development Team nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
About Kiwi
----------
Chris Colbert began the Kiwi project in December 2013 in an effort to
create a blisteringly fast UI constraint solver. Chris is still the
project lead.
The Nucleic Development Team is the set of all contributors to the Nucleic
project and its subprojects.
The core team that coordinates development on GitHub can be found here:
http://github.com/nucleic. The current team consists of:
* Chris Colbert
Our Copyright Policy
--------------------
Nucleic uses a shared copyright model. Each contributor maintains copyright
over their contributions to Nucleic. But, it is important to note that these
contributions are typically only changes to the repositories. Thus, the Nucleic
source code, in its entirety is not the copyright of any single person or
institution. Instead, it is the collective copyright of the entire Nucleic
Development Team. If individual contributors want to maintain a record of what
changes/contributions they have specific copyright on, they should indicate
their copyright in the commit message of the change, when they commit the
change to one of the Nucleic repositories.
With this in mind, the following banner should be used in any source code file
to indicate the copyright and license terms:
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------------------------------------
Project-URL: homepage, https://github.com/nucleic/kiwi
Project-URL: documentation, https://kiwisolver.readthedocs.io/en/latest/
Project-URL: repository, https://github.com/nucleic/kiwi
Project-URL: changelog, https://github.com/nucleic/kiwi/blob/main/releasenotes.rst
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: typing-extensions ; python_version < "3.8"
Welcome to Kiwi
===============
.. image:: https://travis-ci.org/nucleic/kiwi.svg?branch=main
:target: https://travis-ci.org/nucleic/kiwi
.. image:: https://github.com/nucleic/kiwi/workflows/Continuous%20Integration/badge.svg
:target: https://github.com/nucleic/kiwi/actions
.. image:: https://github.com/nucleic/kiwi/workflows/Documentation%20building/badge.svg
:target: https://github.com/nucleic/kiwi/actions
.. image:: https://codecov.io/gh/nucleic/kiwi/branch/main/graph/badge.svg
:target: https://codecov.io/gh/nucleic/kiwi
.. image:: https://readthedocs.org/projects/kiwisolver/badge/?version=latest
:target: https://kiwisolver.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Kiwi is an efficient C++ implementation of the Cassowary constraint solving
algorithm. Kiwi is an implementation of the algorithm based on the
`seminal Cassowary paper <https://constraints.cs.washington.edu/solvers/cassowary-tochi.pdf>`_.
It is *not* a refactoring of the original C++ solver. Kiwi has been designed
from the ground up to be lightweight and fast. Kiwi ranges from 10x to 500x
faster than the original Cassowary solver with typical use cases gaining a 40x
improvement. Memory savings are consistently > 5x.
In addition to the C++ solver, Kiwi ships with hand-rolled Python bindings for
Python 3.7+.
Metadata-Version: 2.1
Name: matplotlib
Version: 3.5.2
Summary: Python plotting package
Home-page: https://matplotlib.org
Download-URL: https://matplotlib.org/users/installing.html
Author: John D. Hunter, Michael Droettboom
Author-email: matplotlib-users@python.org
License: PSF
Project-URL: Documentation, https://matplotlib.org
Project-URL: Source Code, https://github.com/matplotlib/matplotlib
Project-URL: Bug Tracker, https://github.com/matplotlib/matplotlib/issues
Project-URL: Forum, https://discourse.matplotlib.org/
Project-URL: Donate, https://numfocus.org/donate-to-matplotlib
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Matplotlib
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE/LICENSE
License-File: LICENSE/LICENSE_AMSFONTS
License-File: LICENSE/LICENSE_BAKOMA
License-File: LICENSE/LICENSE_CARLOGO
License-File: LICENSE/LICENSE_COLORBREWER
License-File: LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER
License-File: LICENSE/LICENSE_QT4_EDITOR
License-File: LICENSE/LICENSE_SOLARIZED
License-File: LICENSE/LICENSE_STIX
License-File: LICENSE/LICENSE_YORICK
Requires-Dist: cycler >=0.10
Requires-Dist: fonttools >=4.22.0
Requires-Dist: kiwisolver >=1.0.1
Requires-Dist: numpy >=1.17
Requires-Dist: packaging >=20.0
Requires-Dist: pillow >=6.2.0
Requires-Dist: pyparsing >=2.2.1
Requires-Dist: python-dateutil >=2.7
|PyPi|_ |Downloads|_ |NUMFocus|_
|DiscourseBadge|_ |Gitter|_ |GitHubIssues|_ |GitTutorial|_
|GitHubActions|_ |AzurePipelines|_ |AppVeyor|_ |Codecov|_ |LGTM|_
.. |GitHubActions| image:: https://github.com/matplotlib/matplotlib/workflows/Tests/badge.svg
.. _GitHubActions: https://github.com/matplotlib/matplotlib/actions?query=workflow%3ATests
.. |AzurePipelines| image:: https://dev.azure.com/matplotlib/matplotlib/_apis/build/status/matplotlib.matplotlib?branchName=master
.. _AzurePipelines: https://dev.azure.com/matplotlib/matplotlib/_build/latest?definitionId=1&branchName=master
.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/github/matplotlib/matplotlib?branch=master&svg=true
.. _AppVeyor: https://ci.appveyor.com/project/matplotlib/matplotlib
.. |Codecov| image:: https://codecov.io/github/matplotlib/matplotlib/badge.svg?branch=master&service=github
.. _Codecov: https://codecov.io/github/matplotlib/matplotlib?branch=master
.. |LGTM| image:: https://img.shields.io/lgtm/grade/python/github/matplotlib/matplotlib.svg?logo=lgtm&logoWidth=18
.. _LGTM: https://lgtm.com/projects/g/matplotlib/matplotlib
.. |DiscourseBadge| image:: https://img.shields.io/badge/help_forum-discourse-blue.svg
.. _DiscourseBadge: https://discourse.matplotlib.org
.. |Gitter| image:: https://badges.gitter.im/matplotlib/matplotlib.svg
.. _Gitter: https://gitter.im/matplotlib/matplotlib
.. |GitHubIssues| image:: https://img.shields.io/badge/issue_tracking-github-blue.svg
.. _GitHubIssues: https://github.com/matplotlib/matplotlib/issues
.. |GitTutorial| image:: https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?
.. _GitTutorial: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project
.. |PyPi| image:: https://badge.fury.io/py/matplotlib.svg
.. _PyPi: https://badge.fury.io/py/matplotlib
.. |Downloads| image:: https://pepy.tech/badge/matplotlib/month
.. _Downloads: https://pepy.tech/project/matplotlib
.. |NUMFocus| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
.. _NUMFocus: https://numfocus.org
.. image:: https://matplotlib.org/_static/logo2.svg
Matplotlib is a comprehensive library for creating static, animated, and
interactive visualizations in Python.
Check out our `home page <https://matplotlib.org/>`_ for more information.
.. image:: https://matplotlib.org/_static/readme_preview.png
Matplotlib produces publication-quality figures in a variety of hardcopy
formats and interactive environments across platforms. Matplotlib can be used
in Python scripts, the Python and IPython shell, web application servers, and
various graphical user interface toolkits.
Install
=======
For installation instructions and requirements, see the `install documentation
<https://matplotlib.org/stable/users/installing/index.html>`_ or
`installing.rst <doc/users/installing/index.rst>`_ in the source.
Contribute
==========
You've discovered a bug or something else you want to change - excellent!
You've worked out a way to fix it – even better!
You want to tell us about it – best of all!
Start at the `contributing guide
<https://matplotlib.org/devdocs/devel/contributing.html>`_!
Contact
=======
`Discourse <https://discourse.matplotlib.org/>`_ is the discussion forum for
general questions and discussions and our recommended starting point.
Our active mailing lists (which are mirrored on Discourse) are:
* `Users <https://mail.python.org/mailman/listinfo/matplotlib-users>`_ mailing
list: matplotlib-users@python.org
* `Announcement
<https://mail.python.org/mailman/listinfo/matplotlib-announce>`_ mailing
list: matplotlib-announce@python.org
* `Development <https://mail.python.org/mailman/listinfo/matplotlib-devel>`_
mailing list: matplotlib-devel@python.org
Gitter_ is for coordinating development and asking questions directly related
to contributing to matplotlib.
Citing Matplotlib
=================
If Matplotlib contributes to a project that leads to publication, please
acknowledge this by citing Matplotlib.
`A ready-made citation entry <https://matplotlib.org/stable/users/project/citing.html>`_ is
available.
Research notice
~~~~~~~~~~~~~~~
Please note that this repository is participating in a study into
sustainability of open source projects. Data will be gathered about this
repository for approximately the next 12 months, starting from June 2021.
Data collected will include number of contributors, number of PRs, time taken
to close/merge these PRs, and issues closed.
For more information, please visit `the informational page
<https://sustainable-open-science-and-software.github.io/>`__ or download the
`participant information sheet
<https://sustainable-open-science-and-software.github.io/assets/PIS_sustainable_software.pdf>`__.
Metadata-Version: 2.1
Name: numpy
Version: 1.26.4
Summary: Fundamental package for array computing in Python
Home-page: https://numpy.org
Author: Travis E. Oliphant et al.
Maintainer-Email: NumPy Developers <numpy-discussion@python.org>
License: Copyright (c) 2005-2023, NumPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the NumPy Developers nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Project-URL: Homepage, https://numpy.org
Project-URL: Documentation, https://numpy.org/doc/
Project-URL: Source, https://github.com/numpy/numpy
Project-URL: Download, https://pypi.org/project/numpy/#files
Project-URL: Tracker, https://github.com/numpy/numpy/issues
Project-URL: Release notes, https://numpy.org/doc/stable/release
Requires-Python: >=3.9
Description-Content-Type: text/markdown
<h1 align="center">
<img src="https://raw.githubusercontent.com/numpy/numpy/main/branding/logo/primary/numpylogo.svg" width="300">
</h1><br>
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](
https://numfocus.org)
[![PyPI Downloads](https://img.shields.io/pypi/dm/numpy.svg?label=PyPI%20downloads)](
https://pypi.org/project/numpy/)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/numpy.svg?label=Conda%20downloads)](
https://anaconda.org/conda-forge/numpy)
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](
https://stackoverflow.com/questions/tagged/numpy)
[![Nature Paper](https://img.shields.io/badge/DOI-10.1038%2Fs41592--019--0686--2-blue)](
https://doi.org/10.1038/s41586-020-2649-2)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/numpy/numpy/badge)](https://api.securityscorecards.dev/projects/github.com/numpy/numpy)
NumPy is the fundamental package for scientific computing with Python.
- **Website:** https://www.numpy.org
- **Documentation:** https://numpy.org/doc
- **Mailing list:** https://mail.python.org/mailman/listinfo/numpy-discussion
- **Source code:** https://github.com/numpy/numpy
- **Contributing:** https://www.numpy.org/devdocs/dev/index.html
- **Bug reports:** https://github.com/numpy/numpy/issues
- **Report a security vulnerability:** https://tidelift.com/docs/security
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
Testing:
NumPy requires `pytest` and `hypothesis`. Tests can then be run after installation with:
python -c "import numpy, sys; sys.exit(numpy.test() is False)"
Code of Conduct
----------------------
NumPy is a community-driven open source project developed by a diverse group of
[contributors](https://numpy.org/teams/). The NumPy leadership has made a strong
commitment to creating an open, inclusive, and positive community. Please read the
[NumPy Code of Conduct](https://numpy.org/code-of-conduct/) for guidance on how to interact
with others in a way that makes our community thrive.
Call for Contributions
----------------------
The NumPy project welcomes your expertise and enthusiasm!
Small improvements or fixes are always appreciated. If you are considering larger contributions
to the source code, please contact us through the [mailing
list](https://mail.python.org/mailman/listinfo/numpy-discussion) first.
Writing code isn’t the only way to contribute to NumPy. You can also:
- review pull requests
- help us stay on top of new and old issues
- develop tutorials, presentations, and other educational materials
- maintain and improve [our website](https://github.com/numpy/numpy.org)
- develop graphic design for our brand assets and promotional materials
- translate website content
- help with outreach and onboard new contributors
- write grant proposals and help with other fundraising efforts
For more information about the ways you can contribute to NumPy, visit [our website](https://numpy.org/contribute/).
If you’re unsure where to start or how your skills fit in, reach out! You can
ask on the mailing list or here, on GitHub, by opening a new issue or leaving a
comment on a relevant issue that is already open.
Our preferred channels of communication are all public, but if you’d like to
speak to us in private first, contact our community coordinators at
numpy-team@googlegroups.com or on Slack (write numpy-team@googlegroups.com for
an invitation).
We also have a biweekly community call, details of which are announced on the
mailing list. You are very welcome to join.
If you are new to contributing to open source, [this
guide](https://opensource.guide/how-to-contribute/) helps explain why, what,
and how to successfully get involved.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment