Saravanan666/pypi-org huggingface dataset:
Package: matplotvideo
matplotvideo - syncing video and matplotlibWhat is it?matplotvideois a Python package providing an easy way to sync matplotlib plots to video.
Some of the features:Frame-accurate seeking forward and backwardPlayback speed control between 0.01x and 4xAuto frame-skip to maintain playback speed when plot takes to longSeek with slider through entire videoIntuitive pause/play toggle using spacebarPlay allcv2supported media typesWhere to get itThe source code is currently hosted on GitHub at:https://github.com/PySport/matplotvideoInstallers for the latest released version are available at thePython
package index.# or PyPIpipinstallmatplotvideoThe package requirescv2to be installed. When you don't have it installed yet, you can check outopencv-python.Video player controls:Sync between Scene Change data plot and video'a'1 frame back'd'1 frame forwardspacetoggle paused / playescquit video playerplayback speedcan be changed with the sliderplayback positioncan be changed with the sliderApplication examplesVerify data using videoEnrich video with additional data, like computer vision model outputFind interesting video/data framesUsageImportattach_video_player_to_figureand attach to matplotlib figure. You can pass additional keyword arguments toattach_video_player_to_figurethat are passed to theon_framecallback on each invocation.frommatplotvideoimportattach_video_player_to_figureimportmatplotlib.pyplotasplt# (timestamp, value) pairs# sample: big bunny scene cutsfancy_data=[(0,1),(11.875,1),(11.917,2),(15.75,2),(15.792,3),(23.042,3),(23.083,4),(47.708,4),(47.75,5),(56.083,5),(56.125,6),(60,6)]defon_frame(video_timestamp,line):timestamps,y=zip(*fancy_data)x=[timestamp-video_timestampfortimestampintimestamps]line.set_data(x,y)line.axes.relim()line.axes.autoscale_view()line.axes.figure.canvas.draw()defmain():fig,ax=plt.subplots()plt.xlim(-15,15)plt.axvline(x=0,color='k',linestyle='--')line,=ax.plot([],[],color='blue')attach_video_player_to_figure(fig,"BigBuckBunny.mp4",on_frame,line=line)plt.show()main()
Package: matplotview
matplotviewA small library for creating lightweight views of matplotlib axes.matplotview provides a simple interface for creating "views" of matplotlib
axes, providing a simple way of displaying overviews and zoomed views of
data without plotting data twice.InstallationYou can install matplotview using pip:pipinstallmatplotviewExamplesExamples can be found in the example gallery:https://matplotview.readthedocs.io/en/latest/examples/index.htmlDocumentationAdditional documentation can be found at the link below:https://matplotview.readthedocs.io/en/latest/
Package: matpopmod
Matpopmod - Matrix Population Models in PythonMatpopmod is a Python library for the study of matrix
population models. It can be used to:compute a wide variety of demographic descriptors;study and plot deterministic and stochastic trajectories;access the COMPADRE/COMADRE databases.See theproject homepagefor more information.InstallationMatpopmod requires Python ≥3.6 with NumPy ≥1.10 and Matplotlib. You
can install the latest stable version from PyPI with:python3 -m pip install matpopmodUsageMatpopmod can be used interactively or as a library in Python scripts.
See thequickstart guideand thedocumentationfor details.DevelopmentContributions are welcome on theGit lab repository.Installing the development versionYou can install the current development version using:python3 -m pip install https://gitlab.com/bienvenu/matpopmod/-/archive/master/matpopmod-dev.tar.gzHowever, if you want to be able to run the tests, build the
documentation and contribute, we recommend fetching the source and
setting up adevelopment environmentwith:git clone https://gitlab.com/bienvenu/matpopmod.git
python3 -m venv env
source env/bin/activate
python3 -m pip install -e matpopmod/Running testspython3 -m pip install pytest
pytest matpopmodShow test coverage:python3 -m pip install pytest-cov
pytest --cov=matpopmod --cov-report html
python3 -m http.server 8002 # serveBuilding the documentation# HTML documentation in /public
python3 -m pip install sphinx
cd matpopmod
sphinx-build -b html doc/ public# PDF documentation in /public
python3 -m pip install sphinx
cd matpopmod
sphinx-build -b latex doc/ public
cd public
pdflatex matpopmod.texBuilding the packageThe version number is maintained insrc/matpopmod/VERSION.python3 -m build .
# To upload the package on PyPI
python3 -m twine upload dist/*LicenseThis project is licensed under the GNU Lesser General Public License v3.0
or later.
Package: matpowercaseframes
MATPOWER Case FramesParse MATPOWER case into pandas DataFrame.Unlike thetutorialonmatpower-pip, this package supports parsing MATPOWER case usingreinstead ofOct2Pyand Octave. After that, you can further parse the data into any format supported by your solver.Installationpip install matpowercaseframesUsageThe main utility ofmatpowercaseframesis to help readmatpowerdata in user-friendly format as follows,frommatpowercaseframesimportCaseFramescase_path='case9.m'cf=CaseFrames(case_path)print(cf.gencost)If you havematpowerinstalled viapip install matpower(did not requirematpower[octave]), you can easily navigatematpowercase using:importosfrommatpowerimportpath_matpower# require `pip install matpower`frommatpowercaseframesimportCaseFramescase_name='case9.m'case_path=os.path.join(path_matpower,'data',case_name)cf=CaseFrames(case_path)print(cf.gencost)Furthermore,matpowercaseframesalso support generating data that is acceptable bymatpowerviamatpower-pippackage (requirematlaboroctave),frommatpowercaseframesimportCaseFramescase_path='case9.m'cf=CaseFrames(case_path)mpc=cf.to_dict()m=start_instance()m.runpf(mpc)To save allDataFrameto a singlexlsxfile, use:frommatpowercaseframesimportCaseFramescase_path='case9.m'cf=CaseFrames(case_path)cf.to_excel('PATH/TO/DIR/case9.xlsx')If you usematpower[octave],CaseFramesalso supportoct2py.io.Structas input using:frommatpowerimportstart_instancefrommatpowercaseframesimportCaseFramesm=start_instance()# support mpc before runpfmpc=m.loadcase('case9',verbose=False)cf=CaseFrames(mpc)print(cf.gencost)# support mpc after runpfmpc=m.runpf(mpc,verbose=False)cf=CaseFrames(mpc)print(cf.gencost)m.exit()AcknowledgmentThis repository was supported by theFaculty of Engineering, Universitas Gadjah Madaunder the supervision ofMr. Sarjiya. If you use this package for your research, we are very glad if you cite any relevant publication under Mr. Sarjiya's name as thanks (but you are not responsible to cite). You can find his publications in thesemanticscholar](https://www.semanticscholar.org/author/Sarjiya/2267414) orIEEE.This package is a fork and simplification frompsstMATPOWER parser, thus we greatly thank psst developers and contributors.
Package: matprod
MatProdFast repeated multiplication of 2x2 matrices in a compiled numpy extension.Why does this existThis extension is the solution to a performance problem with the repeated multiplication of 2x2 numpy matrices in python.  For some applications in computational science, it is necessary to take the product of between 1E4 and 1E8 matrices in a performant manner.  In numpy this can be done with a for loop.  However, this introduces a tight loop in python which adds significant overhead to the task.  In addition, if the matrices being multiplied are small, there is additional overhead in the for loops used for the matrix product that may be avoided.  The performance difference between the python implementation and this c implementation of repeated matrix multiplication is order of magnitude 1,000x.InstallationThis package is available through on PyPi.  Simply runpip install matprod.UsageAll functions in the library accept a numpy array of the n 2x2 matrices to be multiplied together.  The arrayMsshould have the shape (2,2,n) whereMs[:,:,0]is the first matrix,Ms[:,:,1]is the second, and so on.Two functions are presently exported from the extension.  These arelprod(Ms)andcumlprod(Ms)which perform the repeated matrix left product and the cumulative left product of the matrices respectively.  By left product I mean that the result oflprod(Ms)is equivalent to the codeMs[:,:,n] @ ... @ Ms[:,:,2] @ Ms[:,:,1] @ Ms[:,:,0]in numpy.  The cumulative left product will also return all of the intermediate products in a (2,2,n) numpy array.  The first element will beret[:,:,0] = Ms[:,:,0], the second and third will beret[:,:,0] = Ms[:,:,1] @ Ms[:,:,0],ret[:,:,0] = Ms[:,:,2] @ Ms[:,:,1] @ Ms[:,:,0], and so on.Test the code out with this simple example:import matprod

# Create a set of matrices to multiply
Ms = np.random.rand(2,2,10000)

# Take the left product
print(matprod.lprod(Ms))

# Try out the cumulative product
print(matprod.cumlprod(Ms)[:,:,-1])PerformanceThe time taken to multiply 10,000 2x2 matrices by a python implementation and this library can be compared with the following scripts.import matprod
import numpy as np
import timeit
import functools as f

# Make a test array
arr = np.random.rand(2,2,10000)*1.06

# Test the speed of the new method
testfun_new = lambda: matprod.lprod(arr)
print("Execution Time New: {:.0f} us".format(timeit.timeit(testfun_new, number=10000)/10000*1e6))

# Test the speed of the old method
testfun_old = lambda: f.reduce(np.dot, arr.T).T
print("Execution Time Old: {:.0f} ms".format(timeit.timeit(testfun_old, number=100)/100*1e3))

# Make sure they are the same
print()
print('Relative Difference of Elements:')
print((testfun_new() - testfun_old())/testfun_old())On my 2016-era laptop, the output of this scripts wasExecution Time New: 37 us
Execution Time Old: 25 ms

Relative Difference of Elements:
[[-6.56716376e-16 -1.34748247e-15]
 [-9.04050404e-16 -1.27529490e-15]]This is a nearly three orders of magnitude speed-up over the python implementation!  The results are also identical to machine precision.Reporting Issues and Feature RequestsPlease file an issue on the projects github pagehere.
Package: matprop
MatPropMatProp is a small PyTorch-like backpropagation engine and neural network
framework defined with autograd-supported matrix operations.InstallationAs simple as it gets!pipinstallmatpropNeural Network UsageThe following shows the fit and training code of a fully-connected
neural network on a sine wave, full example in nn_demo.ipynbmodel=MLP(n_inputs=1,layer_outputs=[12,12,1])lr=0.01loss_hist=[]forepochintqdm(range(500)):# forward passpreds=[model(x)forxinXs]loss=mse_loss(preds,ys)# backward passmodel.zero_grad()loss.backward()# updateforpinmodel.parameters():p.data-=lr*p.gradloss_hist.append(loss.data.squeeze())Matrix UsageThe following shows some MatProp Matrix operations with full autograd support,
full example and outputs in matrix_demo.ipynbA=Matrix([[1.,2.]])B=Matrix([[3.,2.],[2.,1.]])AB=A@BAB2=AB**3Relu=AB2.relu()Sum=Relu.sum()Sum.backward()Running TestsThe test suite tests agreement between MatProp Matrix operations and
PyTorch Tensor operations, both in the foward and backward passes.
To run them, simply runpython -m pytestin the base project
directory. (PyTorch needed obviously)InspirationMatProp was heavily inspired byAndrej Kaparthy's Microgradand hisYouTube video explaining it in detail.
However, MatProp is expanded and shifted in scope by being defined
with matrix operations rather than scalar operations. I highly
recommend giving his video a watch, it is the single best explanation
on how backprop works I have seen.
Package: matprops
Matpropsmatpropsis a Python library for visualizing proportional data. It is build above matplotlib (the visualization library). Understanding proportional data is quite easy but when it comes to bigger picture we lack of seeing everythingInstallationBinary installers for the latest released version are available at thePython
Package Index (PyPI)# PyPIpipinstallmatpropsThe source code is currently hosted onGitHubArea proportional chartArea proportional charts also known as square area proportional charts is a very easy and basic proportional chart to know first in list. matprops provide a lage amount of customization in creating square area proportional charts# Pandas - DataFrame Supportimportpandasaspd# Matpropsfrommatpropsimportpropsprops is a subclass doing its work for simple proportional charts# Creating a dataframe with the help of pandasdataset=pd.DataFrame({'Country':['France','Germany','United Arab Emirates'],'Men (%)':[60,80,30],'Capital':['Paris','Berlin','Mecca']})# Changing the limits# Limit : 0 -> 1dataset["Men (%)"]=dataset["Men (%)"]/100Reducing the limits is mandatory as the matprops is all about proportional charts we need to get the value down to 0 -> 1 range. Ignoring the limits may cause unexpected warnings and errorsSimple square area proportional charts are capable of showing some insights through this datapt.AreaProp(dataset,"Men (%)",labels=True,title="Country",description="Capital")Try customizing the graph with everything possiblematpropsprovides fast and reliable data visualizations for proportional data. matprops currently work only for labelled data for which it is found to be more helpful in defining proportions. matprops aims to move more than proportional charts in upcoming versions. We have enough proportional chart libraries around the Python community, but the thing that differs matprops is its creativity and customization. Some rare visualizations are about to be worked on matprops soon
Package: matr
matrDeveloper GuideSetup# create conda environment$mambaenvcreate-fenv.yml# update conda environment$mambaenvupdate-nmatr--fileenv.ymlInstallpipinstall-e.# install from pypipipinstallmatrnbdev# activate conda environment$condaactivatematr# make sure the matr package is installed in development mode$pipinstall-e.# make changes under nbs/ directory# ...# compile to have changes apply to the matr package$nbdev_preparePublishing# publish to pypi$nbdev_pypi# publish to conda$nbdev_conda--build_args'-c conda-forge'$nbdev_conda--mambabuild--build_args'-c conda-forge -c dsm-72'UsageInstallationInstall latest from the GitHubrepository:$pipinstallgit+https://github.com/dsm-72/matr.gitor fromconda$condainstall-cdsm-72matror frompypi$pipinstallmatrDocumentationDocumentation can be found hosted on GitHubrepositorypages. Additionally you can find
package manager specific guidelines oncondaandpypirespectively.
Package: matrad
MATRAD: a Python trading interfance for BinanceMantradenables you to interact with theBinance APIwith PythonInstallationpip install matradAPI Functions availableThe available API functions with their properties (especiallyendpointandmethod) are listedproperties.endpoint_mapping.Call a functionfrom utils import execute_query
execute_query(function_name, params, data)wherefunction_nameis a key inproperties.endpoint_mapping,datais a Dict corresponding to the query string arguments andparamsa Dict corresponding to th request body.Other utilitiesYour current timestampYou can get your current rimestam throughutils.get_current_timestamp(). Is useful fortiming your trades.SignatureSome API function require asignatureto proceed. This is handles seamlessly byutils.execute_query()throughutils.get_hashmap_signature().Coin pairsAll the coin pairs handled by the Binance API can be generated or updated locally throughutils.update_pair_list()and returned byutils.get_all_pairs().Compare API urlsThe API url are listed inproperties.urls. Their ping speed can be compred throughutils.get_urls_speeds().API keysYour API key and secret must be stored in the user home directory in a file called.binance_api_secretsin this format:{
    "key": "aBccc",
    "secret": "xYzzz"
}
Package: mat-rajagopal
matrix operationsThis is a matrix operations package.This matrix package has  1 modules and 28 functions1.mat_input(rows,columns)-enter rows and columns2.unit_mat(dimension)-unit matrix is presents of 1 in diagonals.enter the no.of.rows or columns3.constant_mat(constant,dimension)-constant matrix contains same numbers.enter the constant and no.of.rows4.mat_multiple(matrix1,matrix2):
normal matrix multiplication5.mat_add(matrix1,matrix2): matrix addition6.mat_sub(matrix1,matrix2): matrix subtraction7.mat_div(matrix1,matrix2): matrix division8.mat_trace(matrix1): trace of matrix9.mat_transpose(matrix1): transpose of the matrix10.det(matrix1): determinant of 2x2 , 3x3 matrix11.adjoint(matrix1): adjoint of matrix 2x2 and 3x3 matrix12.area(point1,point2,point3): area of triangle13.cramer(equation matrix,equal to matrix): value of x,y or x,y,z for three equations14.mat_inverse(matrix1): inverse of matrix15.element_mul(matrix1,matrix2): element wise multiplication for matrix16.mul_commutative(matrix1,matrix2): commutative property on multiplication17.mul_assosiative(matrix1,matrix2,matrix3): assosiative property on multiplication18.mul_distributive(matrix1,matrix2,matrix3): distributive property of matrix19.add_commutative(matrix1,matrix2): commutative property on addition of matrix20.add_assosiative(matrix1,matrix2,matrix3): associative property oon addition21.additive_identity(matrix1,matrix2): additive identity of matrix22.additive inverse(matrix1,matrix2): additive inverse of matrix23.unitnum_mat(constant,dimension): diagonals have give number24.mat_ortho(matrix1): orthogonal property of matrix25.double transpose(matirx1): tranpose of a tranpose matrix:((a)T)T=a26.sum_transpose(matrix1): transpose of sum of two matrix=sum of two transpose matrix   (a+b)T=(a)T+(b)T27.mul_transpose(matrix1):multiplication transpose is (a*b)T=(b)T * (a)T28.scalar_mul_transpose(matrix1):multiplication of constant with a matrix whole transpose = multiplication
of a constant with the transpose of matrix  (const*a)T=const * (a)TYou can useGithub-flavored Markdownto write your content.
Package: matrax
Matrix Games in JAXEnter the Matrax! 😎Installation|QuickstartMatraxis a lightweight suite of2-player matrix gameenvironments written inJAX. It is a direct re-implementation of the matrix games provided inthis repositoryfrom theAARG. It follows theJumanjiRL environment suite API developed byInstaDeep.2-Player Matrix Games 🧑‍🤝‍🧑CategoryShape (action space)Registered Version(s)Source🔻 Penalty Game3 x 3Penalty-{k}-{state}-v0code🧗‍♀️ Climbing Game3 x 3Climbing-{state}-v0code🤝 No-Conflict Games2 x 2NoConflict-{id}-{state}-v0code💣 Conflict Games2 x 2Conflict-{id}-{state}-v0codeInstallation 🎬You can install the latest release ofMatraxfrom PyPI:pipinstallmatraxAlternatively, you can install the latest development version directly from GitHub:pipinstallgit+https://github.com/instadeepai/matrax.gitMatraxhas been tested on Python 3.8 and 3.9.
Note that because the installation of JAX differs depending on your hardware accelerator,
we advise users to explicitly install the correct JAX version (see theofficial installation guide).Quickstart ⚡importjaximportmatrax# Instantiate a matrix game environment using the registryenv=matrax.make("Penalty-25-stateless-v0")# Reset your (jit-able) environmentkey=jax.random.PRNGKey(0)state,timestep=jax.jit(env.reset)(key)# Interact with the (jit-able) environmentaction=env.action_spec().generate_value()# Action selection (dummy value here)state,timestep=jax.jit(env.step)(state,action)# Take a step and observe the next state and time stepRegistry and Versioning 📖Like Jumanji,Matraxkeeps a strict versioning of its environments for reproducibility reasons.
We maintain a registry of standard environments with their configuration.
For each environment, a version suffix is appended, e.g.EnvironmentName-v1.
When changes are made to environments that might impact learning results,
the version number is incremented by one to prevent potential confusion.See Also 🔎Other works have embraced the approach of writing RL environments in JAX.
In particular, we suggest users check out the following sister repositories:🌴Jumanjiis a diverse suite of scalable reinforcement learning environments.🦾Braxis a differentiable physics engine that simulates
environments made up of rigid bodies, joints, and actuators.🏋️‍Gymnaximplements classic environments including
classic control, bsuite, MinAtar and a collection of meta RL tasks.🎲Pgxprovides classic board game environments like
Backgammon, Shogi, and Go.
Package: matreshka
matreshkaMatresha - программа распаковывает *tar.gz архив вложенный как матрешка.СтартУстановкаpip install matreshkaУдаление пакетаpip uninstall matreshkaРабота с пакетомПодключениеfrom matreshka import bumШаблон для архиваПринцип в том, что каждый архив внутри следующего, имеет свой номер и этот
шаблон может быть любым, лишь число ведущих нулей может быть разным.%(number)0<здесь количество нулей>d.tar.gz - не изменяемая часть шаблона.Шаблон архиваarchive-%(number)03d.tar.gzИмя архиваВсегда начинается отсчет с 1 не с нуля.archive-001.tar.gzИспользование100 - глубина вложенности, на ваше усмотрение. Файл архива должен лежать в
той же директории, где и код mt.py.Скопируйте код в файл mt.pyfrom matreshka import bum

tmp = 'archive-%(number)03d.tar.gz'
bum(tmp, 100)Запуск из консолиpython3 mt.py
Package: matrex
matrexmatrexstands forMatrixReordering algorithms.The library implements the Modified Sloan Row Ordering (MSRO) algorithm. By permuting the rows of a matrix, the algorithm minimizes the mean/max front size of this matrix. The front size minimization can be viewed in the following example :Here, the black squares represent the position in the matrix where there is a non-zero value. The columns of the matrix have been reordered so that those values are closer together as much as possible in each row. The mean of this distance (difference between first and last non-zero index in a row) is shown on top of those pictures (before vs after msro application).The original Fortran implementation is calledmc62and is part of the HSL library.InstallationYou can installmatrexusingpip:pipinstallmatrexor by directly downloading it from this github :pipinstallmatrex@git+https://github.com/benjaminlanthier/matrexThe MSRO algorithmThispaperby Jennifer A. Scott describes the logic and structure of the MSRO algorithm. It iteratively selects rows to be part of the new permutation according to a priority function. In the paper, the authors use the following priority function:$$
\begin{equation}
P_i = -W_1 \text{rcgain}_i + W_2 d(i, e),
\end{equation}
$$We implement a slightly different priority function described in themanual for mc62:$$
\begin{equation}
P_i = -W_1 \text{rcgain}_i + W_2 d(i, e) - W_3 \text{nold}_i.
\end{equation}
$$In both equations, we have that:$\text{rcgain}_i$ is "the increases to the row and column front sizes resulting from assembling row $i$ next" [1]$d(i, e)$ is the distance between the row $i$ and the row $e$, where $e$ is the target row, found by using the pseudodiameter of the row graph of the input matrix.$\text{nold}_i$ is "the number of variables in row $i$ that are candidates for elimination and have already been brought into the front" [2].Exampleimportnumpyasnpfrommatreximportmsrom=np.array([[1,1,1,0,0,0],[0,1,1,0,1,0],[1,1,0,1,0,0],[0,0,1,0,1,1],[0,1,1,0,1,0]])# For the rows reorderingnew_columns_order=msro(m)reordered_rows_matrix=m[new_columns_order]# For the columns reorderingnew_columns_order=msro(m.T)reordered_cols_matrix=m[:,new_columns_order]DependenciesPackages needed to run this algorithm :numpynetworkxOptional:matplotlib(for visualizing the row graph)References[1] Scott, Jennifer A. ‘A New Row Ordering Strategy for Frontal Solvers’. Numerical Linear Algebra with Applications, vol. 6, no. 3, Apr. 1999, pp. 189–211.DOI.[2] HSL, a collection of Fortran codes for large-scale scientific computation. See theirsite.