Saravanan666/pypi-org huggingface dataset:
Package: pycziutils
Python utilities to read (tiled) CZI files and parse metadata through python-bioformatsFree software: BSD licenseDocumentation:https://pycziutils.readthedocs.io.Installation$pipinstallpycziutilsFeaturesA tiny utility module to parse Zeiss CZI files in Python through python-bioformats.
Parse tiled images, organize planes into pandas.DataFrame, and parse some hard-to-get metadata.Exampleimportpycziutils@pycziutils.with_javabridgedefmain():czi_file_path="path/to/czi/file.czi"tiled_czi_ome_xml=pycziutils.get_tiled_omexml_metadata(czi_file_path)tiled_properties_dataframe=pycziutils.parse_planes(tiled_czi_ome_xml)print(tiled_properties_dataframe.columns)#Index(['index', 'X', 'Y', 'Z', 'T', 'C', 'C_index', 'T_index', 'Z_index', 'image',#       'plane', 'image_acquisition_T', 'absolute_T'],#        dtype='object')print(tiled_properties_dataframe.iloc[0])#index                                                 0#X                                             -1165.624#Y                                               122.694#Z                                                 0.001#T                                                 1.027#C                                                 Phase#C_index                                               0#T_index                                               0#Z_index                                               0#image                                                 0#plane                                                 0#image_acquisition_T    2021-04-12 02:12:21.340000+00:00#absolute_T             2021-04-12 02:12:22.367000+00:00#Name: 0, dtype: object#returns bioformats reader for tiled imagesreader=pycziutils.get_tiled_reader(czi_file_path)fori,rowintiled_properties_dataframe.iterrows():image=reader.read(series=row["image"],t=row["T_index"],z=row["Z_index"],c=row["C_index"],)if__name__=="__main__":main()CreditsThis package usespython-bioformatsto connect CZI files to Python.This package was created withCookiecutterand thewboxx1/cookiecutter-pypackage-poetryproject template.This package usespysenfor linting and formatting.
Package: pyczml
Requests-REST: A RESTful client based on requestsThis library intends to provide an elegant RESTful client.Installationpipinstallrequests-restUsage examplebase_url='https://httpbin.org/'new_name='aponder'new_email='i@aponder.top'new_user={'name':new_name,'email':new_email,}update_user=new_user.copy()update_user.update({'name':f'new {new_name}'})# print(resource_user.list().json())
# print(resource_user.create(new_user).json())
# print(resource_user.update(1, new_user).json())
# print(resource_user.patch(1, new_name).json())
# print(resource_user.patch(1, new_email).json())
# print(resource_user.delete(1).json())resource_client=Client(base_url,debug=True)Users=resource_client('users')users_creating=Users.create(new_user)print(users_creating.response)users_listing=Users.list(page=1,page_size=10)print(users_listing.response)users_detailing=Users.detail(1)print(users_detailing.response)users_updating=Users.update(2,update_user)print(users_updating.response)users_partial_updating=Users.partial_update(3,update_user)print(users_partial_updating.response)users_deleting=Users.delete(4)print(users_deleting.response)# extra actionsUsers.login=Users.make_plural_action('login')credentials={'username':'root','password':'root'}print(Users.login(credentials).response)Users.disable=Users.make_single_action('disable')print(Users.disable(2).response)# resource combinationBlogs=resource_client('blogs')UsersBlogs=users_detailing(Blogs)new_blog={'title':'hello'}print(UsersBlogs.create(new_blog).response)print(UsersBlogs.list(page=2,page_size=20).response)print(UsersBlogs.delete(10).response)print(UsersBlogs.update(10,new_blog).response)print(UsersBlogs.partial_update(10,new_blog).response)print(UsersBlogs.delete(10).response)
Package: py-d2
py-d2An unofficial, fully typed python interface for building.d2diagram files in python.Installationpipinstallpy-d2Usagefrompy_d2importD2Diagram,D2Shape,D2Connection,D2Styleshapes=[D2Shape(name="shape_name1",style=D2Style(fill="red")),D2Shape(name="shape_name2",style=D2Style(fill="blue"))]connections=[D2Connection(shape_1="shape_name1",shape_2="shape_name2")]diagram=D2Diagram(shapes=shapes,connections=connections)withopen("graph.d2","w",encoding="utf-8")asf:f.write(str(diagram))produces the following graph.d2 file:shape_name1: {
  style: {
    fill: red
  }
}
shape_name2: {
  style: {
    fill: blue
  }
}
shape_name1 -> shape_name2This can be rendered usingd2 graph.d2 graph.svg && open graph.svgorhttps://play.d2lang.com/to produceSee thetestsfor more detailed usage examples.Supported FeaturesShapes (nodes)Connections (links)StylesContainers (nodes/links in nodes)Shapes in shapesArrow directionsMarkdown / block strings / code in shapesIcons in shapesSQL table shapesClass shapesCommentsDevelopmentPrerequisitePython 3.7+Poetry 1.3pre-commitInstallationfollowing the steps below to setup the project:```bash# Clone the repositorygitclonegit@github.com:MrBlenny/py-d2.git&&cdpy-d2# Install all dependenciespoetryinstall--sync--all-extras--withdev,test,coverage# install git hook scripts for developmentpre-commitinstall# Install dependencies with group 'dev'、'test' for developmentpoetryinstall--withdev,test# Only install required dependencies for productionpoetryinstallUsageThere are some useful commands for development:# Run the examplepoetryrunexample# Debug with ipdb3poetryrunipdb3./src/py_d2/main.py# Code testpoetryrunpytest-s# Run default coverage testpoetryruntox# Run example project coverage test at python 3.9 and 3.10poetryruntox-epy{39,310}-py-d2# Lint with blackpoetryrunblack./src--check# Format code with blackpoetryrunblack./src# Check with mypypoetryrunmypy./src# Check import order with isortpoetryrunisort./src--check# Lint with flake8poetryrunflake8./src
Package: pyD3TN
pyD3TNpyD3TN is a collection of protocol implementations of theDelay-Tolerant
Networking (DTN) Architecture(RFC4838) for Python.Besides theBundle ProtocolimplementationsBPv6andBPv7,
implementations of theConvergence Layer Adapters(CLAs) for TCP
(MTCP,TCPCLv3) and the Space Packet Protocol (SPP)
are included.InstallationFrom source:gitclonehttps://gitlab.com/d3tn/ud3tncdpyd3tn
pythonsetup.pyinstallFromPyPidirectly:pipinstallpyd3tnDevelopmentpyD3TN is maintained as part of the µD3TN project and follows its development
processes. Please see theµD3TNrepository for the code and further
information.
Package: pydaa
DAA Python WrapperThis is a Python package that provides a wrapper for theDAA C++ library. It allows users to access
the functionality of the C++ library from Python code.The DAA library is a fast and efficient library that provides a set of
algorithms for data analysis. The Python wrapper provides a convenient interface
for Python developers who want to use the DAA library in their projects.InstallationThe DAA Python Wrapper can be installed via pip:pipinstalldaaNote that in order to use the DAA Python Wrapper, the DAA C++ library must be
installed on your system. Instructions for building and installing the DAA
library can be found in the DAA repository.UsageTo use the DAA Python Wrapper in your Python code, start by importing the
module:importdaa...From here, you can use the functions provided by the DAA library. The Python
wrapper provides an interface for all of the functions in the DAA library, so
consult the DAA documentation for details on how to use the individual
functions.ContributingIf you find a bug or have an idea for a new feature, please open an issue in the
GitHub repository. Pull requests are also welcome.LicenseThis package is licensed under the MIT License. See the LICENSE file for
details.
Package: pydaal
Python bindings to Intel® Data Analytics Acceleration Library -- optimized building blocks for all data analytics stages, from data preparation to data mining & machine learning. Optimizes data ingestion and algorithmic compute together for the highest performance. Supports offline, streaming, and distributed usage models to meet a range of application needs. Highly tuned for efficient data layout, blocking, multi-threading, vectorization --
helping applications deliver better predictions faster, and enabling analysis of larger data sets with the same compute resources.One of many Intel® accelerated Python packages and performance library runtimes available onPyPI, and as part ofIntel® Distribution for Python.For latest release updates and security notifications, pleasesubscribeto the Intel® Distribution for Python Community forum.Free to use and redistribute pursuant to theIntel Simplified Software License.
Package: pyDAC
pyDACpyDAC (python Directly Addressable Codes) offers a variable-length encoding scheme for (unsigned) integers with random access to any element of the encoded sequence.In terms of compression, a DAC structure is very likely to outperform standardbase-128 compression schemesaka VByte, Varint, VInt, EncInt etc..As a bonus, a DAC structure gives to random access to each and every sequence element without any decoding.InstallationInstall from PyPi usingpipinstallpyDACUsagefrompyDACimportDACimports the module.importrandomfrompyDACimportDACvalues=random.sample(range(2**32),10**7)encoded_values=DAC(iter(values))creates a DAC structureencoded_valuesfor thevaluessequence.AccessTheith element from the originalvaluessequence can be retrieved from a DAC structureencoded_valuesusing the subscript operatorforiinrange(len(values)):assertvalues[i]==encoded_values[i]A DAC structureencoded_valuesis also iterable.You can easily loop through the stored elements storeddac_iter=iter(encoded_values)whileTrue:try:val=next(dac_iter)exceptStopIteration:break# Iterator exhausted: stop the loopelse:print(val)or return all stored elements at onceassertvalues==list(iter(encoded_values))MiscellaneousA DAC structure can providecompression ratiosandspace_savingsin comparision to the minimal fixed width representation and to the variable byte representation of the originalvaluessequence.For example,values=[1,2,1,8,3,4,5,9,13,1024,262189]encoded_values=DAC(iter(values))print(encoded_values.space_savings)>>>{'vbyte':0.08214285714285718,'fixed_width':0.508133971291866}print(encoded_values.compression_ratios)>>>{'vbyte':1.0894941634241246,'fixed_width':2.0330739299610894}Attributions@article{title={{AlgorithmsandCompressedDataStructuresforInformationRetrieval}},author = {Ladra, Susana},type = {Phd Thesis},institution = {Universidade da Coru{\~{n}}a},pages = {272},year = {2011},isbn = {5626895531}}@inproceedings{title={{Directlyaddressablevariable-lengthcodes}},author = {Brisaboa, Nieves R. and Ladra, Susana and Navarro, Gonzalo},booktitle = {Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)},volume = {5721 LNCS},doi = {10.1007/978-3-642-03784-9_12},isbn = {3642037836},issn = {03029743},pages = {122--130},publisher = {Springer, Berlin, Heidelberg},year = {2009}}LicenseThis work is licensed under aCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Package: pydace
DescriptionThis project is an adaptation from the work of Hans Bruun Nielsen, SÃ¸ren Nymand and Lophaven Jacob SÃ¸ndergaard.NotesThis is a implementation that relies heavily on linear algebra solvers(least-squares solvers, Cholesky and QR
decompositions, etc.). Therefore, it is strongly advised that your numpy library be integrated to aBLAS library(e.g.: Intel-MKL, OpenBLAS, ATLAS, etc.)
in order to attain satisfactory performances of calculation.For the sake of convenience, Anaconda handles the gritty details of how to combine numpy and those libraries natively.InstallationTo install through PyPi Repository:pip install pydaceTo install via condaconda install -c felipes21 pydaceUsageExample with dace modelimportnumpyasnpimportscipy.ioassiofrompydaceimportDaceimportmatplotlib.pyplotasplt# Load the training and validation data. (Here we are using a file from the# github repo located in the folder pydace\tests with the name# 'doe_final_infill_mat'mat_contents=sio.loadmat('doe_final_infill.mat')design_data=mat_contents['MV']# design sitesobserved_data=mat_contents['CV']# experiment results# define the hyperparameters bounds and initial estimatetheta0=1*np.ones((design_data.shape[1],))lob=1e-5*np.ones(theta0.shape)upb=1e5*np.ones(theta0.shape)# select the training and validation datadesign_val=design_data[:99,:]observed_val=observed_data[:99,:]design_train=design_data[100:,:]observed_train=observed_data[100:,:]# build the univariate kriging models with a first order polynomial# regression and a gaussian regression modelobserved_prediction=np.empty(observed_val.shape)forjinnp.arange(design_data.shape[1]):# initialize the dace objectdace_obj=Dace('poly1','corrgauss',optimizer='boxmin')# fit the training data using the default hyperparameter optimizerdace_obj.fit(design_train,observed_train[:,j],theta0,lob,upb)# predict the validation dataobserved_prediction[:,[j]],*_=dace_obj.predict(design_val)# labels for the observed datavar_labels=['L/F','V/F','xD','xB','J','QR']# plot the validation dataforvarinnp.arange(design_data.shape[1]):plt.figure(var+1)plt.plot(observed_val[:,var],observed_prediction[:,var],'b+')plt.xlabel(var_labels[var]+' - Observed')plt.ylabel(var_labels[var]+' - Kriging Prediction')plt.show()Example of design of experiment data generationIt is also possible to generate design of experiment data with a variation reduction technique called Latin Hypercube
Sampling (LHS) that is already implemented in this toolbox.Lets say we have a 4-th dimensional problem (i.e. 4 design/input variables). They are defined by the following bounds.If we want to build a latin hypercube within these bounds we would do the following:importnumpyasnpfrompydace.aux_functionsimportlhsdesignlb=np.array([8.5,0.,102.,0.])ub=np.array([20.,100.,400.,400.])lhs=lhsdesign(53,lb,ub,include_vertices=False)Contact/Talk to meMy e-email isfelipe.lima@eq.ufcg.edu.br. Feel free to contact me anytime, or just nag me if I'm being lazy.
Package: pydacefit
pydacefitThe documentation can be found here:https://www.egr.msu.edu/coinlab/blankjul/pydacefit/The purpose of this clone is to have a python version of the popular dacefit toolbox in MATLAB .
The toolbox can be foundhere.This framework is an exact clone of the original code and the correctness has been checked.
Please contact me if you should be scenarios where the values are significantly different (10^6).InstallationThe test problems are uploaded to the PyPi Repository.pipinstallpydacefitUsageimportnumpyasnpfrompydacefit.corrimportcorr_gauss,corr_cubic,corr_exp,corr_expg,corr_spline,corr_sphericalfrompydacefit.daceimportDACE,regr_linear,regr_quadraticfrompydacefit.regrimportregr_constantimportmatplotlib.pyplotasplt# -----------------------------------------------# Different ways of initialization# -----------------------------------------------# regression can be: regr_constant, regr_linear or regr_quadraticregression=regr_constant# regression = regr_linear# regression = regr_quadratic# then define the correlation (all possible correlations are shown below)# please have a look at the MATLAB document for more detailscorrelation=corr_gauss# correlation = corr_cubic# correlation = corr_exp# correlation = corr_expg# correlation = corr_spline# correlation = corr_spherical# correlation = corr_cubic# This initializes a DACEFIT objective using the provided regression and correlation# because an initial theta is provided and also thetaL and thetaU the hyper parameter# optimization is donedacefit=DACE(regr=regression,corr=correlation,theta=1.0,thetaL=0.00001,thetaU=100)# if no lower and upper bounds are defined, then no hyperparameter optimization is executeddacefit_no_hyperparameter_optimization=DACE(regr=regression,corr=correlation,theta=1.0,thetaL=None,thetaU=None)# to turn on the automatic relevance detection use a vector for theta and define boundsdacefit_with_ard=DACE(regr=regression,corr=correlation,theta=[1.0,1.0],thetaL=[0.001,0.0001],thetaU=[20,20])# -----------------------------------------------# Create some data for the purpose of testing# -----------------------------------------------deffun(X):returnnp.sum(np.sin(X*2*np.pi),axis=1)X=np.random.random((20,1))F=fun(X)# -----------------------------------------------# Fit the model with the data and predict# -----------------------------------------------# create the model and fit itdacefit.fit(X,F)# predict values for plotting_X=np.linspace(0,1,100)[:,None]_F=dacefit.predict(_X)# -----------------------------------------------# Plot the results# -----------------------------------------------plt.scatter(X,F,label="prediction")plt.plot(_X,_F,label="data")plt.legend()plt.show()print("MSE: ",np.mean(np.abs(fun(_X)[:,None]-_F)))ContactFeel free to contact me if you have any question:Julian Blank (blankjul [at] egr.msu.edu)Michigan State UniversityComputational Optimization and Innovation Laboratory (COIN)East Lansing, MI 48824, USA
Package: pydacharts
pydachartsPydantic :heart: chartjs
This is a code generator forChartJSconfiguration JSON.Set UpPip install the package withpip install pydachartsor clone the repoUse the class generator to write a "config" file. One simple examplefrompydacharts.modelsimportConfig,Data,Datasetdefspending_by_year_chartjs()->Config:"""Return a chartjs "config" object for sip datasetcharting"""returnConfig(type="bar",data=Data(labels=["Green is nice","Red is angry","Blue is calming"],datasets=[Dataset(backgroundColor=["green","red","blue"],data=[1,2,3],label="We love colors")]))(This example should work standalone)For running examplesRun Examplespip install flask
cd serve
flask rungo to localhost:5000Buildingpoetry build
poetry version patch # or "major", "minor"
poetry publishDevelopingClone ineditablemodepip install -e git+git://github.com/joshbrooks/pydacharts/#egg=pydacharts
Package: pydactory
pydactorypydactoryis a factory library forpydanticmodels with an API inspired byfactory_boy.InstallationPyPI:https://pypi.org/project/pydactory/pip install pydactoryFeaturespydactoryis...low boilerplate: provides default values for many common types. You don't need to tellpydactoryhow to build yourname: strfieldsfamiliar: define your factories like you define yourpydanticmodels: in a simple, declarative syntaxGetting startedDeclare yourpydanticmodelsfromdatetimeimportdatetimefromtypingimportOptionalfrompydanticimportBaseModel,FieldclassAddress(BaseModel):street1:strstreet2:strcity:strstate:strzip_code:str=Field(max_length=5)classAuthor(BaseModel):name:straddress:Addressdate_of_birth:datetimeclassBook(BaseModel):title:str=Field(alias="Title")author:Author=Field(alias="Author")pages:int=Field(alias="PageCount")publish_date:datetime=Field(alias="PublishDate")isbn_13:str=Field(alias="ISBN-13")isbn_10:Optional[str]=Field(alias="ISBN-10")Declare your factoriesfrompydactoryimportFactoryclassAuthorFactory(Factory[Author]):name="Leo Tolstoy"classBookFactory(Factory[Book]):title="War and Peace"author=AuthorFactorypublish_date=datetime.todayUse the factories to build your modelsdeftest_book_factory():book:Book=BookFactory.build(title="Anna Karenina")assertBook(title="Anna Karenina",author=Author(name="Leo Tolstoy",address=Address(street1="fake",street2="fake",city="fake",state="fake",zip_code="fake"),date_of_birth=datetime.datetime(2000,1,1,0,0),),pages=1,publish_date=datetime.datetime(2021,3,26,14,15,22,613309),isbn_13="fake",isbn_10=None,)==bookRoadmappydactoryis still very much in progress.
Package: pydaddy
PyDaddyA Python package to discover stochastic differential equations from time series data.PyDaddy is a comprehensive and easy to use python package to discover data-derived stochastic differential equations from time series data. PyDaddy takes the time series of state variable $x$, scalar or 2-dimensional vector, as input and discovers an SDE of the form:$$ \frac{dx}{dt} = f(x) + g(x) \cdot \eta(t) $$where $\eta(t)$ is Gaussian white noise. The function $f$ is called thedrift, and governs the deterministic part of the dynamics. $g^2$ is called thediffusionand governs the stochastic part of the dynamics.An example summary plot generated by PyDaddy, for a vector time series dataset.PyDaddy also provides a range of functionality such as equation-learning for the drift and diffusion functions using sparse regresssion, a suite of diagnostic functions, etc.. For more details on how to use the package, check out theexample notebooksanddocumentation.Schematic illustration of PyDaddy functionality.InstallationPyDaddy is available both on PyPI and Anaconda Cloud, and can be installed on any system with a Python 3 environment. If you don't have Python 3 installed on your system, we recommend usingAnacondaorMiniconda. See the PyDaddypackage documentationfor detailed installation instructions.Using pipTo install the latest stable release version of PyDaddy, use:pip install pydaddyTo install the latest development version of PyDaddy, use:pip install git+https://github.com/tee-lab/PyDaddy.gitUsing anacondaTo install usingconda,AnacondaorMinicondaneed to be installed first. Once this is done, use the following command.conda install -c tee-lab pydaddyDocumentationFor more information about PyDaddy, check out thepackage documentation.CitationIf you are using this package in your research, please cite the repository and the associatedpaperas follows:Nabeel, A., Karichannavar, A., Palathingal, S., Jhawar, J., Danny Raj, M., & Guttal, V. (2022). PyDaddy: A Python Package for Discovering SDEs from Time Series Data (Version 0.1.5) [Computer software].https://github.com/tee-lab/PyDaddyNabeel, A., Karichannavar, A., Palathingal, S., Jhawar, J., Danny Raj, M., & Guttal, V. (2022). PyDaddy: A Python package for discovering stochastic dynamical equations from timeseries data. arXiv preprintarXiv:2205.02645.LicencePyDaddy is distributed under theGNU General Public License v3.0.
Package: pydaedalus
Daedalus source code is copyright (c) 1998-2016 Walter D. Pullen.Wrapper is copyright (c) 2017 Will Roberts <wildwilhelm@gmail.com>.Licensed under the GNU General Public License version 2.A Python wrapper of theDaedalusmaze generator.  This project is
currently built against version 3.2 of the Daedalus software.QuickstartInstall:pip install pydaedalusGetting started:>>> from daedalus import Maze
>>> maze = Maze(63, 63)
>>> maze.create_perfect()
>>> maze.resize(31, 61)
>>> maze.create_perfect()
>>> maze.save_bitmap('test.bmp')
>>> maze.save_text('test.txt')A Maze can be treated as a 2D array of Bools (walls are True and
passages are False), or as a container of lists of ints (walls are 1
and passages are 0):>>> maze.width, maze.height
(31, 61)
>>> maze[0,0]
True
>>> maze[1,1]
False
>>> maze[1,2]
False
>>> maze[1,3]
False
>>> maze[1]
[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1]
>>> len(maze)
61Take a look atdemo.ipynbto see visualisations of some of the
kinds of Mazes Daedalus can create.RequirementsPython 2.7, or 3.3+,A C++ compiler with C++11 support (GCC 4.7+, clang 3.3+).Development NotesTo compile the Cython extension:python setup.py build_ext --inplace