Saravanan666/pypi-org huggingface dataset:
Package: pymassspec-plot
Plotting extension for PyMassSpec.DocsTestsPyPIAnacondaActivityQAOtherInstallationPyMassSpec-Plotcan be installed from PyPI or Anaconda.To install withpip:$python-mpipinstallPyMassSpec-PlotTo install withconda:First add the required channels$condaconfig--addchannelshttps://conda.anaconda.org/bioconda$condaconfig--addchannelshttps://conda.anaconda.org/conda-forge$condaconfig--addchannelshttps://conda.anaconda.org/domdfcodingThen install$condainstallPyMassSpec-Plot
Package: pymastermind
pymastermindDescriptionA Python package designed toplay,developstrategies/algorithms, andimplementthe classicMasterMindboard game. It even includes a functioning, text-based implementation of MasterMind!InstallationThe source code forpymastermindis hosted onGitHub. You can install matermind through PyPI, with pip:pipinstallpymastermindRequirementspymastermindrequires the following libraries:pandas, used by theSelfGameobjecttqdm, used to display progress bars when finding next guess.Note: only some algorithms support progress bars. See "Algorithms" below.DocumentationRead the full documentation forpymastermindhere.Example UsagePlayPlay a game against your computer, or have your computer play itself, by runningmain()and following text-based instructions.>>>main()# initiate the game; print instructions & wait for inputsClassesSeveral useful classes are defined in thepymastermindmodule.CodeCode objects are list instances designed to store a MasterMind codes. You can compare two codes by using the.compare()method.What's comparing?>>>secret_code=Code(['a','b','c','d'])>>>guess=Code(['b','c','j','d'])>>>len(secret_code)==len(guess)True>>>secret_code.compare(guess)(1,2)Note: code objects must be of the same length to comapre.GameGame objects are used to immitate gameplay.>>>my_game=Game()# default: slots == 4, colors == ['a', 'b', 'c', 'd', 'e', 'f']>>>secret_code=Code(['e','a','f','f'])>>>my_game.guess# always the same for given setup; see Wikipedia article['a','a','b','b']>>>blacks_and_whites=secret_code.compare(my_game.guess)>>>blacks_and_whites(1,0)>>>my_game.new_guess(response,algorithm='minmax')# new guess using minmax algorithm (see below)>>>my_game.guess['a','c','c','d']>>>my_game.back()# go back one turn>>>my_game.guess['a','a','b','b']Read thedocumentationfor an in-depth look at all the attributes and methods of aGame.AlgorithmsA new guess can be generated using several different algorithms. Currently,pymastermindhas two algorithms implemented:random (default algorithm)Set the guess to a random secret code possibilityNo progress bar support yetminmaxSet the guess to the guess that has the highest min-max score ofallguesses. Read morehere.Supports progress barsSee the full documentation for a more detailed description of the algorithms.SelfGameSelfGame is a subclass of Game that is used to "play" games with specified algorithms and obtain a pandasDataFramefull of information about the games played.>>>my_self_game=SelfGame()# same defaults, so slots == 4, colors == ['a', 'b', 'c', 'd', 'e', 'f']>>>df=my_self_game.play()# default: games == 10, algorithm == 'random'>>>type(df)<class'pandas.core.frame.DataFrame'>>>>df.loc['Game 3','Turn 2']# example queryTime0days00:00:00.000610StartPossibilities23EndPossibilities4Name:Game3,dtype:objectLicenseMIT
Package: pymata-aio
pymata_aio is a high performance, non-blocking, Python asyncio client
for the Firmata Protocolthat supports the complete StandardFirmata
protocol.Major featuresPython 3.5+ compatible.Choose From 3 Included APIspymata_core - a pure asyncio method call API.pymata3 - A non-asyncio proxy for pymata_corepymata_iot - A websocket based backed to control an Arduino over a Web page.Implements 100% of the StandardFirmata Protocol (StandardFirmata 2.5.3).Auto-detects Arduino COM ports.FirmataPlus (enhanced StandardFirmata sketch) included with distribution. It adds support for:HC-SR04 Ultrasonic Distance Sensors using a single pin.Stepper Motors.Piezo Tone Generation.2 Pin Rotary Encoder Support.FirmataPlusRB (enhanced StandaradFirmata sketch to control a SparkFun Redbot. It adds support for:Piezo Tone Generation.Wheel encoders.RedBot Accelerometer.Ability to automatically capture and time-stamp user specified analog and digital transient input events on a per-pin basis.All 3 APIs support callback as well as a polled interface.
Package: pymata-cpx
Control A Circuit Playground Express From Your PC With An Easy To Use Python 3 APIView the Installation and Usage GuideHere.It supports the following CPX devices:The Buttons and Slide Switch.The D13 Board LED.The 10 onboard neo-pixels.Tone generation using the onboard speaker.The accelerometer, including tap sensing.The temperature sensor.The light sensor.The sound sensor.Touchpad sensors.An example to animate the neopixels and to start and stop the animation
by simply tapping the Playground Express:importrandomimporttimefrompymata_cpx.pymata_cpximportPyMataCpxclassTheTapper():"""Illuminate the neopixels in a counter-clockwise fashion with randomly generated colors.When you tap the playground express, the neopixels will stop changing and theprogram pauses. Tap again and the neopixels will start again."""def__init__(self):# create an instance of the APIself.p=PyMataCpx()print('Tap the playground express to stop the neopixels from moving.')print('Tap again, to start them up')print('The tap state will be printed to the console')# Start monitoring for tap events and# send event notifications to the "tapped" callback method.self.p.cpx_tap_start(self.tapped)# flag to start and stop the light showself.go=TruewhileTrue:try:# run the light showforneopixelinrange(0,10):# check the go flagifself.go:self.p.cpx_pixels_clear()self.p.cpx_pixels_show()r=random.randint(0,254)g=random.randint(0,254)b=random.randint(0,254)self.p.cpx_pixel_set(neopixel,r,g,b)self.p.cpx_pixels_show()time.sleep(.2)else:self.p.cpx_pixels_clear()self.p.cpx_pixels_show()time.sleep(.001)exceptKeyboardInterrupt:# If you press control-C, cleanly exitself.p.cpx_pixels_clear()self.p.cpx_pixels_show()self.p.cpx_close_and_exit()deftapped(self,data):""":param data: data[0] = data type (analog = 2, digital =32)data[1] = pin for device 27data[2] = tap data - list of booleans.First value for 1 tapSecond value for 2 taps"""# for any taps, toggle the go flag# print out the current go stateifdata[2]!=[False,False]:self.go=notself.goprint(self.go)# start the programTheTapper()
Package: pymata-express
pymata-expressA high performance, Python asyncio client for the Arduino Firmata Protocol.Pymata-Express is a Firmata client that, like its conventional Python sibling,pymata4,allows you to control an Arduino using the high-performance FirmataExpress sketch.It supports both an enhanced version of StandardaFirmata 2.5.8, called FirmataExpress, as well as StandardFirmata and StandardFimataWiFi.FirmataExpressadds support for:HC-SR04 Ultrasonic Distance Sensors using a single pin.DHT Humidity/Temperature Sensors.Stepper Motors.Piezo Tone Generation.Baud rate of 115200Major featuresFully documentedintuitive APIPython 3.7+ compatible.Set the pin mode and go!Data change events may be associated with a callback function or each pin can be polled for its last event change.Each data change event is time stamped and logged.User's Guide, Including Examples.Implements 100% of the StandardFirmata Protocol (StandardFirmata 2.5.8).Advanced auto-detection of Arduino devices (when using FirmataExpress).Here is an example that monitors for data changes on a digital input pin.importasyncioimporttimeimportsysfrompymata_expressimportpymata_express"""Setup a pin for digital input and monitor its changesusing a callback."""# Setup a pin for analog input and monitor its changesDIGITAL_PIN=12# arduino pin numberIDLE_TIME=.001# number of seconds for idle loop to sleep# Callback data indices# Callback data indicesCB_PIN_MODE=0CB_PIN=1CB_VALUE=2CB_TIME=3asyncdefthe_callback(data):"""A callback function to report data changes.This will print the pin number, its reported value andthe date and time when the change occurred:param data: [pin, current reported value, pin_mode, timestamp]"""date=time.strftime('%Y-%m-%d%H:%M:%S',time.localtime(data[CB_TIME]))print(f'Pin:{data[CB_PIN]}Value:{data[CB_VALUE]}Time Stamp:{date}')asyncdefdigital_in(my_board,pin):"""This function establishes the pin as adigital input. Any changes on this pin willbe reported through the call back function.:param my_board: a pymata_express instance:param pin: Arduino pin number"""# set the pin modeawaitmy_board.set_pin_mode_digital_input(pin,callback=the_callback)whileTrue:try:awaitasyncio.sleep(IDLE_TIME)exceptKeyboardInterrupt:awaitboard.shutdown()sys.exit(0)# get the event looploop=asyncio.get_event_loop()# instantiate pymata_expressboard=pymata_express.PymataExpress()try:# start the main functionloop.run_until_complete(digital_in(board,12))except(KeyboardInterrupt,RuntimeError)ase:loop.run_until_complete(board.shutdown())sys.exit(0)Sample console output as input change events occur:Pin:12Value:0TimeStamp:2020-03-1013:26:22
Pin:12Value:1TimeStamp:2020-03-1013:26:27
Package: pymatbridge
PymatbridgeA python interface to call out to Matlab(R).License informationCopyright (c) 2012 – , Max Jaderberg, Ariel Rokem, Haoxing Zhao
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 Oxford University, Stanford University 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.
Package: pymatched
pymatched⇒What is pymatched?pymatched is a library which provides functional pattern matching.InstallationpipinstallpymatchedSyntaxresult=match(<'func'>)>>Mapping[Hashable,Any]Match orderexact matchoneof matchplaceholder match (if target is immutable iterable)type match with guard (Contravariant match)type match (Invariant match)type match (Contravariant match)handling default if existsUsageNote: How to match mutable value?as you know, mutable things cannot be key of dict so we can not match easly.this is the example of list.Case A: use type guardsx=match([1,2,3])>>{list:"list",oneof([1],[1,2],[1,2,3]):"[1] | [1, 2] | [1, 2, 3]",(list,lambdax:x==[1,2,3]):"(list, f(list) -> bool)",# [1, 2, 3]: "[1, 2, 3]",  --> list is unhashable so not working}Case B: use nested matchx=match([1,2,3])>>{list:match(...)>>{(list,lambdav:v==[1,_,3]):"pattern is (1, * ,3)",...:"default"}}Value matchfrompymatchedimportmatchmatch(1)>>{1:"It's 1",5:"It's 5",}Handling default caseuse elipsis...ortyping.Anyif nothing catched but default handler not defined, RuntimeError will be raised.fromtypingimportAnyfrompymatchedimportmatchmatch(None)>>{...:"default",# Any: "also default",}Type matchfrompymatchedimportmatchmatch(42)>>{int:"int caught",...:lambdav:f"{type(v)}caught"}Type match with guardIf tuple's first element is type and second element is lambda, this case will be considered as type match with guard.frompymatchedimportmatchmatch(42)>>{(int,lambda:v:v==42):"42 caught",int:"int except 42",}type match with guard can usetyping.Any.fromtypingimportAnyfrompymatchedimportmatchmatch(42)>>{(Any,lambda:v:vin(42,"42")):"42 caught",int:"int except 42",}Exception match in type matchpymatched.dowraps executing function. when wrapped function raises error,docatch it and return it as normal return.frompymatchedimportmatch,dodeffx(v):raiseException("Ooops!")match(do(fx,None))>>{Exception:"exception caught",...:lambdav:f"{v}caught",}Oneof matchfrompymatchedimportoneof,matchfx=lambdax:xmatch(fx(5))>>{oneof(1,2,3):"one of 1, 2, 3",oneof(4,5,6):"one of 4, 5, 6",}Placeholder matchfrompymatchedimportoneof,matchmatch((1,2,3,4))>>{# change (1, 2, 3, 4) into (100, 2, 3, 4) or (1, 9, 3, 9)(1,_,3,_):"pattern (1, *, 3, *)",(_,2,_,4):"pattern (*, 2, *, 4)",}Nested matchIf match withpymatchied._(PlaceholderTyoe) or...(Ellipsis), this match will be considered as nested match.frompymatchedimportmatch,_match(5)>>{int:match(_)>>{5:"It's 5",...:"default"},}Mixed matchcases could be mixed, but resolved by designated match order.frompymatchedimportoneof,matchv=(1,2,3)x=match(v)>>{tuple:"Tuple caught",(tuple,lambdav:v[-1]==3):"last item of tuple is 3",(1,_,3):"pattern is (1, *, 3)".oneof((1,),(1,2),(1,2,3)):"one of (1,) | (1, 2) | (1, 2, 3)",(1,2,3):"(1, 2, 3)"}
Package: py-matching-pattern
Python Pattern MatchingInspired bypampyandcore.match, this is a pattern matching library for dynamic list of patterns.Right now it only supports matching lists of same sizes.UsageImport the libimportPatternMatchStorefrompy_matching_patternFirst you will add initialize aPatternMatchStorewith a fixed size of keys to match (size of the list).pmdb=PatternMatchStore(keysize=3)After that you can add the patterns. Every value is valid match, includingNone.The "catch all" value isdefaultattribute of the instance._=pmdb.defaultpmdb.put(keys=["a","b","c"],value=1)pmdb.put(keys=["a","b","b"],value=2)pmdb.put(keys=["a","b",_],value=3)pmdb.put(keys=["a",_,_],value=4)pmdb.put(keys=["a",None,"c"],value=5)pmdb.put(keys=["a",_,"d"],value=6)These patterns are staged for the DB. This is useful if you reload the patterns from another thread.To make the pattern live, you commit it.pmdb.commit()Now you can finally start matching values:pmdb.get(keys=["a","b","c"])==1pmdb.get(keys=["a","b","b"])==2pmdb.get(keys=["a","b","d"])==3pmdb.get(keys=["a","c","d"])==4pmdb.get(keys=["a",None,"c"])==5pmdb.get(keys=["a","e","d"])==6pmdb.get(keys=["e","e","e"])==NoneThe staged patterns are kept between commits, so you can add or override to it later.But in case you want to clean it:pmdb.clean()It can also raise an exception if not found, but by default it will returnNone:pmdb=core.PatternMatchStore(keysize=3,raise_on_notfound=True)pmdb.get(keys=["e","e","e"])# raise KeyNotFoundLicenseMIT
Package: pymatchlib
Library provides:tools for performing operations on functions and polynomialsuseful tools for linear algebra, integration, calculus etc.working functions and powerful objects of Equations, Polynomials and Functions In Rangeand morepymatchlib, due to its power and flexibility, can be used for both scientific projects, but also for much simpler programs. The library is integrated with MongoDB from the very beginning, which allows you to create databases very speedily and get access to them.All pymatchlib wheels distributed on PyPI are MIT licensed.
Package: pyMatchSeries
DescriptionThis is a tool for non-rigid registration, primarily for atomic resolution STEM images, and is a python wrapper of thematch-seriescode developed by B. Berkels. When using this tool, please cite the papers mentioned in that repository.The goal of match-series is to remove slow and fast scan noise in STEM image stacks by comparing the various images against each other. The output of the code are X and Y deformation fields for each image in the stack. These deformations can then be applied to stacks of images or to EDX/EELS spectum maps that were acquired frame by frame. The goal of pymatchseries is to facilitate the set-up of the calculation and to work with the results in python. It is intended to use this tool mainly semi-interactively in a Jupyter notebook, seethe example.Try it out here:To install, simply pip install:$ pip install --user pyMatchSeriesNote that, since it directly tries to call the matchSeries binary in a subprocess,you must compile and/or install match-series on your own. The program is available via conda install:$ conda install -c conda-forge match-seriesChangelogv0.1.0Significantly simplified the API and made code more future proofTrying out CI/CD pipelines
Package: pymaterial
pyMaterialA Python library for material and failure modeling.Usepymaterialto create your own materials:frompymaterial.materialsimportTransverselyIsotropicMaterialmaterial=TransverselyIsotropicMaterial(E_l=141000.0,E_t=9340.0,nu_lt=0.35,G_lt=4500.0,density=1.7e-9)Add failure criteriasfrompymaterial.failureimportCuntzeFailurec_failure=CuntzeFailure()material.add_failure(c_failure)or use the material library of pre-exisiting materialsfrompymaterial.libraryimportsteelsteel.get_failure([256,0.0,0.0])# sigma_x, sigma_y, tau_xyInstallationpipinstallpymaterialDevelopmentFirst make sure you installed everything:pdm syncRunning Python testspdm run pytest --cov pymaterialTODOs
Package: pymatgen-analysis-diffusion
pymatgen-analysis-diffusionFormerly pymatgen-diffusion, this is an add-on to pymatgen for diffusion
analysis that is developed by the Materials Virtual Lab. Note that it relies on
pymatgen for structural manipulations, file io, and preliminary analyses. This is
and will always be, a scientific work in progress. Pls check back regularly for
more details.Major Update (v2021.3.5)pymatgen-analysis-diffusion is now released as a namespace packagepymatgen-analysis-diffusionon PyPI. It should be
imported viapymatgen.analysis.diffusioninsteadpymatgen_diffusion. To install this package via pip:pip install pymatgen-analysis-diffusionFeatures (non-exhaustive!)Van-Hove analysisProbability densityClustering (e.g., k-means with periodic boundary conditions).Migration path finding and IDPP.CitingIf you use pymatgen-diffusion in your research, please cite the following
work:Deng, Z.; Zhu, Z.; Chu, I.H.; Ong, S. P. Data-Driven First-Principles
Methods for the Study and Design of Alkali Superionic Conductors,
Chem. Mater., 2016, acs.chemmater.6b02648, doi:10.1021/acs.chemmater.6b02648.You should also include the following citation for the pymatgen core package
given that it forms the basis for most of the analyses:Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier,
Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent Chevrier, Kristin A.
Persson, Gerbrand Ceder. *Python Materials Genomics (pymatgen) : A Robust,
Open-Source Python Library for Materials Analysis.* Computational
Materials Science, 2013, 68, 314-319. doi:10.1016/j.commatsci.2012.10.028.In addtion, some of the analyses may also have relevant publications that
you should cite. Please consult the documentation of each module.ContributingWe welcome contributions in all forms. If you’d like to contribute, please
fork this repository, make changes and send us a pull request!AcknowledgementsWe gratefully acknowledge funding from the following agencies for the
development of this code:US National Science Foundation’s Designing Materials to Revolutionize and
Engineer our Future (DMREF) program under Grant No. 1436976 for the AIMD
analysis package.US Department of Energy, Oﬃce of Science, Basic Energy Sciences under
Award No. DE-SC0012118 for the NEB analysis package.
Package: pymatgen-io-fleur
Pymatgen-io-fleurThis is apymatgenIO addon for the LAPW codefleur. This addon includes:Reading/writing input files for the the fleur input generator (inpgen)Reading of xml files used by the main fleur codeInstallationpip install pymatgen-io-fleurUsageThis addon adds a classFleurInputto the pymatgen IO namespace, which can read in inpgen and inp.xml files and can write inpgen
input back out.Initializing aFleurInputfrom a filefrompymatgen.io.fleurimportFleurInput#From inpgen input (automatically detected by missing xml in extension)fleur_inp=FleurInput.from_file('inp_example')#From XML inputfleur_inp=FleurInput.from_file('inp.xml')#The object has the following attributesprint(fleur_inp.structure)#Associated structureprint(fleur_inp.title)#Optional title stringprint(fleur_inp.lapw_parameters)#dict with additional LAPW parametersWriting inpgen input back outfleur_inp.write_file('inp_new')#Adding some additional LAPW parametersfleur_inp.write_file('inp_new',parameters={'comp':{'kmax':4.5}})Usage from pymatgenStructureobjectfrompymatgen.coreimportStructure#inpgen input (filename starts with inp_)s=Structure.from_file('inp_test')#XML input (filename is of the form inp*.xml)s=Structure.from_file('inp.xml')s.to('inp_example',format='fleur-inpgen')Licensepymatgen-io-fleuris distributed under the terms and conditions of the MIT license.
Package: pymatgen-lammps
Lammps WrapperLatest ReleaseLicenseBuild StatusThis is a package that I wrote to write input files for LAMMPS and
analyze them because I was not happy with the one built inside ofpymatgen. It has built in calculators for running many lammps
calculations in parallel (many short small LAMMPS calculations).Now that I have put some serious effort into my cython wrapper to
LAMMPS. I would recommend it instead. You get significantly better
performance and LAMMPS is now built into the python
process.lammps-cython.