Saravanan666/pypi-org huggingface dataset:
Package: zmxtools
ZmxToolsA toolkit to read Zemax files.Currently, this is limited to unpacking ZAR archives. For further processing of the archive's contents, e.g. ZMX or AGF
glass files, please check thelist of related softwarebelow.FeaturesUnpack a Zemax OpticStudio® Archive ZAR file using theunzarcommand.Repack a ZAR file as a standard zip file using theunzar -zcommand.Use as a pure Python 3 library.Fully typed with annotations and checked with mypy,PEP561 compatibleInstallationPrerequisitesPython 3.8 or higherpip, the Python package managerTo installzmxtools, just run the following command in a command shell:pipinstallzmxtoolsThezmxtoolslibrary will color-code test output when thecoloredlogspackage is installed. You can optionally
install it withpipinstallcoloredlogsUsageThis package can be used directly from a terminal shell or from your own Python code.
Example files can be found on manufacturer's sites such asThorlabs Inc.Command line shellThe commandunzaris added to the path upon installation. It permits the extraction of the zar-file to a sub-directory
as well as its conversion to a standard zip-file. For example, extracting to the sub-directorymylensis done usingunzar mylens.zarRepacking the same zar-archive as a standard zip-archivemylens.zipis done with:unzar mylens.zar -zMultiple input files and an alternative output directory can be specified:unzar -i *.zar -o some/where/else/Find out more information and alternative options using:unzar -hAs a Python libraryExtraction and repacking can be done programmatically as follows:fromzmxtoolsimportzarzar.extract('mylens.zar')zar.repack('mylens.zar')zar.read('mylens.zar')Pythonpathlib.Pathobjects can be used instead of strings.Online documentationThe latest version of the API Documentation is published onhttps://zmxtools.readthedocs.io/.
The documentation is generated automatically in thedocs/ directoryfrom the source code.Contributing to the source codeThe complete source code can be found ongithub: https://github.com/tttom/zmxtools.
Check outContributingfor details.LicenseThis code is distributed under theagpl3: GNU Affero General Public LicenseCreditsWouter Vermaelenfor decoding the ZAR header and finding LZW compressed contents.Bertrand Bordagefor sharing thisgist.This project was generated withwemake-python-package. Current template version is:cfbc9ea21c725ba5b14c33c1f52d886cfde94416. See what isupdatedsince then.Related SoftwareOptical ToolKitreads Zemax .zmx files.RayTracingreads Zemax .zmx files.Zemax Glassreads Zemax .agf files.RayOpticsreads Zemax .zmx and CODE-V .seq files.RayOptreads Zemax .zmx as well as OSLO files.OpticsPydoes not read Zemax .zmx files but reads CODE-V .seq files and
glass information from data downloaded fromhttps://www.refractiveindex.info/.OpticalGlassreads glass manufacturer Excel sheets.
Package: zn
znZincDevelopment EnvironmentSetupFollow these steps to create a development environment for Zinc:cd ~/projects
git clone git@github.com:blinkdog/zn.git
cd zn
python3.7 -m venv ./env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txtMaintenanceIf you install a new package usingpip installthen update therequirements.txtfile with the following command:pip freeze --all >requirements.txtWorkingThe helper scriptsnakedefines some common project tasks:Try one of the following tasks:

snake clean                # Remove build cruft
snake coverage             # Perform coverage analysis
snake dist                 # Create a distribution tarball and wheel
snake lint                 # Run static analysis tools
snake publish              # Publish the module to Test PyPI
snake rebuild              # Test and lint the module
snake test                 # Test the moduleThe taskrebuilddoesn't really build (no need to compile Python),
but it does run the unit tests and lint the project.Version BumpingIf you need to increase the version number of the project, don't
forget to edit the following:CHANGELOG.md
setup.py
Package: zndraw
ZnDrawInstall viapip install zndraw. If you havepip install pywebviewinstalled,
ZnDraw will open in a dedicated window.[!IMPORTANT]
ZnDraw has undergone a major change with version 0.3.0. The current version is not fully compatible with Windows. We are investigating solutions to make it work again. Furthermore, if you encounter ZnDraw 0.3.0 to be slower at times, this issue will also be mitigated in future releases.CLIYou can use ZnDraw to view a file using the CLIzndraw traj.xyz. Supported
file formats include everything thatase.iocan read and additionallyh5files in the H5MD standard.If you want to view the frames while they are added to the scene you can usezndraw -mp traj.xyz. Seezndraw --helpfor more CLI options.PythonZnDraw provides a Python interface. Thezndraw.ZnDrawobject offersappend,extendas well as assignment operations. More information is available in the
example notebook.fromzndrawimportZnDrawimportasevis=ZnDraw()vis.socket.sleep(2)# give it some time to fully connectvis[0]=ase.Atoms("H2O",positions=[[0.75,-0.75,0],[0.75,0.75,0],[0,0,0]])ZnDraw also provides an interface to the Pythonlogginglibrary, including
support for formatters and different logging levels.importlogginglog=logging.getLogger(__name__)log.addHandler(vis.get_logging_handler())log.critical("Critical Message")ModifierYou can registermodifierto change the scene via the interactions menu.importtypingastfromzndrawimportZnDrawfromzndraw.modifyimportUpdateSceneimportasevis=ZnDraw()classMyModifier(UpdateScene):discriminator:t.Literal["MyModifier"]="MyModifier"defrun(self,vis:ZnDraw,**kwargs)->None:vis.append(molecule("H2O"))vis.register_modifier(MyModifier,default=True,run_kwargs={})User InterfaceDevelopmentZnDraw is developed usinghttps://python-poetry.org/. Furthermore, the
javascript packages have to be installed usinghttps://www.npmjs.com/.cdzndraw/static/
npminstall
Package: znframe
ZnFrame - ASE-like Interface based on dataclassesThis package is designed for light-weight applications that require a structure
for managing atomic structures. It's primary focus lies on the conversion to /
from JSON, to send data around easily.fromznframeimportFramefromase.buildimportmoleculeframe=Frame.from_atoms(molecule("NH3"))print(frame.to_json())Installationpip install znframe
Package: znh5md
ZnH5MD - High Performance Interface for H5MD TrajectoriesZnH5MD allows easy access to simulation results from H5MD trajectories. It
provides a Python interface and can convert existing data to H5MD files as well
as export to other formats.pip install znh5md["dask"]ExampleIn the following example we investigate an H5MD dump from LAMMPS with 1000 atoms
and 201 configurations:importznh5mdtraj=znh5md.DaskH5MD("file.h5",time_chunk_size=500,species_chunk_size=100)print(traj.file.time_dependent_groups)# ['edges', 'force', 'image', 'position', 'species', 'velocity']print(traj.force)# DaskDataSet(value=dask.array<array, shape=(201, 1000, 3), ...)print(traj.velocity.slice_by_species(species=1))# DaskDataSet(value=dask.array<reshape, shape=(201, 500, 3), ...)print(traj.position.value)# dask.array<array, shape=(201, 1000, 3), dtype=float64, chunksize=(100, 500, 3), ...># You can iterate through the dataforitemintraj.position.batch(size=27,axis=0):forxinitem.batch(size=17,axis=1):print(x.value.compute())ASE AtomsYou can use ZnH5MD to store ASE Atoms objects in the H5MD format.ZnH5MD does not support all features of ASE Atoms objects. It s important to
note that unsupported parts are silently ignored and no error is raised.The ASEH5MD interface will not provide any time and step information.If you have a list of Atoms with different PBC values, you can useznh5md.io.AtomsReader(atoms, use_pbc_group=True). This will create apbcgroup inbox/that also containsstepandtime. This is not an official
H5MD specification so it can cause issues with other tools. If you don't
specify this, the pbc of the first atoms in the list will be applied.importznh5mdimportaseatoms:list[ase.Atoms]db=znh5md.io.DataWriter(filename="db.h5")db.initialize_database_groups()db.add(znh5md.io.AtomsReader(atoms))# or znh5md.io.ChemfilesReaderdata=znh5md.ASEH5MD("db.h5")data.get_atoms_list()==atomsCLIZnH5MD provides a small set of CLI tools:znh5md view <file.h5>to view the File usingase.visualizeznh5md export <file.h5> <file.xyz>to export the file to.xyzor any other
supported file formatznh5md convert <file.xyz> <file.h5>to save afile.xyzasfile.h5in the
H5MD standard.More examplesA complete documentation is still work in progress. In the meantime, I can
recommend looking at the tests, especiallytest_znh5md.pyto learn more about
slicing and batching.
Package: zninit
ZnInit - Automatic Generation of__init__based on DescriptorsThis package provides a base class fordataclasslike structures with the
addition of usingDescriptors. The main
functionality is the automatic generation of an keyword-only__init__based on
selected descriptors. The descriptors can e.g. overwrite__set__or__get__or have custom metadata associated with them. TheZnInitpackage is used byZnTrackto enable lazy loading data from
files as well as distinguishing between different types of descriptors such aszn.paramsorzn.outputs. An example can be found in theexamplesdirectory.ExampleThe most simple use case is a replication of a dataclass like structure.fromzninitimportZnInit,DescriptorclassHuman(ZnInit):name:str=Descriptor()language:str=Descriptor("EN")# This will generate the following init:def__init__(self,*,name,language="EN"):self.name=nameself.language=languagefabian=Human(name="Fabian")# orfabian=Human(name="Fabian",language="DE")The benefit of usingZnInitcomes with using descriptors. You can subclass thezninit.Descriptorclass and only add certain kwargs to the__init__defined
ininit_descriptors: list. Furthermore, apost_initmethod is available to
run code immediately after initializing the class.fromzninitimportZnInit,DescriptorclassInput(Descriptor):"""A Parameter"""classMetric(Descriptor):"""An Output"""classHuman(ZnInit):_init_descriptors_=[Input]# only add Input descriptors to the __init__name:str=Input()language:str=Input("DE")date:str=Metric()# will not appear in the __init__def_post_init_(self):self.date="2022-09-16"julian=Human(name="Julian")print(julian)# Human(language='DE', name='Julian')print(julian.date)# 2022-09-16print(Input.get_dict(julian))# {"name": "Julian", "language": "DE"}One benefit ofZnInitis that it also allows for inheritance.fromzninitimportZnInit,DescriptorclassAnimal(ZnInit):age:int=Descriptor()classCat(Animal):name:str=Descriptor()billy=Cat(age=4,name="Billy")
Package: znipy
ZnIPy - Easy imports from Jupyter NotebooksSeeImporting Jupyter Notebooks as Modulesfor more information.fromznipyimportNotebookLoadermodule=NotebookLoader().load_module("JupyterNotebook.ipnyb")hello_world=module.HelloWorld()or with direct importsimportznipyznipy.register()fromJupyterNotebookimportHelloWorldhello_world=HelloWorld()
Package: znjson
ZnJSONPackage to Encode/Decode some common file formats to jsonAvailable viapip install znjsonIn comparison topicklethis allows having readable json files combined with some
serialized data.Exampleimportnumpyasnpimportjsonimportznjsondata=json.dumps(obj={"data_np":np.arange(2),"data":[xforxinrange(10)]},cls=znjson.ZnEncoder,indent=4)_=json.loads(data,cls=znjson.ZnDecoder)The resulting*.jsonfile is partially readable and looks like this:{"data_np":{"_type":"np.ndarray_small","value":[0,1]},"data":[0,1,2,3,4]}Custom ConverterZnJSON allows you to easily add custom converters.
Let's write a serializer fordatetime.datetime.fromznjsonimportConverterBasefromdatetimeimportdatetimeclassDatetimeConverter(ConverterBase):"""Encode/Decode datetime objectsAttributes----------level: intPriority of this converter over others.A higher level will be used first, if thereare multiple converters availablerepresentation: strAn unique identifier for this converter.instance:Used to select the correct converter.This should fulfill isinstance(other, self.instance)or __eq__ should be overwritten."""level=100representation="datetime"instance=datetimedefencode(self,obj:datetime)->str:"""Convert the datetime object to str / isoformat"""returnobj.isoformat()defdecode(self,value:str)->datetime:"""Create datetime object from str / isoformat"""returndatetime.fromisoformat(value)This allows us to use this new serializer:znjson.config.register(DatetimeConverter)# we need to register the new converter firstjson_string=json.dumps(dt,cls=znjson.ZnEncoder,indent=4)json.loads(json_string,cls=znjson.ZnDecoder)and will result in{"_type":"datetime","value":"2022-03-11T09:47:35.280331"}If you don't want to register your converter to be used everywhere, simply use:json_string=json.dumps(dt,cls=znjson.ZnEncoder.from_converters(DatetimeConverter))
Package: znlib
znlibThis package provides you with a CLI to list your installed zincware libraries.When installing viapip install znlib[zntrack]your output should look something like:>>> znlib
Available zincware packages:
  ✓  znlib       (0.1.0)
  ✓  zntrack     (0.4.3)
  ✗  mdsuite 
  ✓  znjson      (0.2.1)
  ✓  zninit      (0.1.1)
  ✓  dot4dict    (0.1.1)
  ✗  znipy 
  ✗  supercharge 
  ✗  znvis 
  ✗  symdetFurthermore,znlibprovides you with some exampleZnTrackNodes.fromznlib.examplesimportMonteCarloPiEstimatormcpi=MonteCarloPiEstimator(n_points=1000).write_graph(run=True)print(mcpi.load().estimate)>>>3.128The idea of theznlibpackage is to provide a collection ofZnTrackNodes from all different fields of research.
Every contribution is very welcome.
For new Nodes:Fork this repository.Create a file under the directoryznlib/examplesMake a Pull request.
Package: zn-operation-table
Zn equivalence classes operation table generatorSimple package to obtain Zn's equivalence classes sum or product operation tables.The build_table method takes an positive integer (n) and 'sum' or 'prod' as first and second arguments.
It will return a nxn matrix with the result of operating every item with each other.Installation:pip install zn_operation_tableExamplebuild_table(3, 'sum')Will return:[[0,1,2], [1,2,0], [2,0,1]]build_table functionbuild_table(n, operation, headers, inversibles)n: positive integer.operation: 'sum' for class sum and 'prod' for class product.headers: for row and column headers.inversibles: tu use the given set's inversibles for the given operation.
Package: znslice
ZnSliceA lightweight library  (without external dependencies) for:advanced slicing.cache__getitem__(self, item)lazy load__getitem__(self, item)InstallationpipinstallznsliceUsageAdvanced Slicing and CacheConvert List toznslice.LazySequenceto allow advanced slicing.importznslicelst=znslice.LazySequence.from_obj([1,2,3],indices=[0,2])print(lst[[0,1]].tolist())# [1, 3]importznsliceimportcollections.abcclassMapList(collections.abc.Sequence):def__init__(self,data,func):self.data=dataself.func=func@znslice.znslicedef__getitem__(self,item:int):print(f"Loading item ={item}")returnself.func(self.data[item])def__len__(self):returnlen(self.data)data=MapList([0,1,2,3,4],lambdax:x**2)assertdata[0]==0assertdata[[1,2,3]]==[1,4,9]# calling data[:] will now only compute data[4] and load the remaining data from cacheassertdata[:]==[0,1,4,9,16]Lazy Database LoadingYou can useznsliceto lazy load data from a database. This is useful if you have a large database and only want to load a small subset of the data.In the following we will use theasepackage to generateAtomsobjects stored in a database and load them lazily.importase.ioimportase.dbimportznsliceimporttqdmimportrandom# create a databasewithase.db.connect("data.db",append=False)asdb:for_inrange(10):atoms=ase.Atoms('CO',positions=[(0,0,0),(0,0,random.random())])db.write(atoms,group="data")# load the database lazilyclassReadASEDB:def__init__(self,file):self.file=file@znslice.znslice(advanced_slicing=True,# this getitem supports advanced slicingnlazy=True# we want to lazy load the data)def__getitem__(self,item):data=[]withase.db.connect(self.file)asdatabase:ifisinstance(item,int):print(f"get{item= }")returndatabase[item+1].toatoms()foridxintqdm.tqdm(item):data.append(database[idx+1].toatoms())returndatadef__len__(self):withase.db.connect(self.file)asdb:returnlen(db)db=ReadASEDB("data.db")data=db[::2]# LazySequence([<__main__.ReadASEDB>], [[0, 2, 4, 6, 8]])data.tolist()# list[ase.Atoms]# supports addition, advanced slicing, etc.data=db[::2]+db[1::2]
Package: zobepy
zobepyzobepy - zobe’s unsorted library.This is an unsorted library made by zobe.usagepippip install zobepyimportimport zobepyand usebsf = zobepy.BinarySizeFormatter(3000)
print(bsf.get())testprerequisitespip install -e ‘.[dev]’unittestpython -m unittest discoverpytestpytesttoxtoxwatch htmlcov/index.html for coverage after toxbuild documentprerequisitespip install -e ‘.[doc]’makecd docs
make html
Package: zocalo-dls
Diamond-specific Zocalo ToolsZocaloservices and wrappers which can be used across teams atDiamond Light Source.There are specialised versions of the services provided by Zocalo, and services
which are useful at Diamond but are not central to Zocalo itself.Much of the data analysis work at Diamond is directed by and presented to users throughISPyB.
Therefore, we provide some central services which enable cooperation between the data analysis pipelines and the ISPyB
database at Diamond.The code in this repository is actively used for processing of many different experiments at Diamond.
The hope is that soon it will be used across many areas of science here and perhaps elsewhere.Please take this code inspiration for how to implement Zocalo at other facilities.Installationpip install zocalo-dlsThis will add several service and wrapper entry points which should appear with:zocalo.service --help
zocalo.wrap --helpContributingThis package is maintained by a core team at Diamond Light Source.To contribute, fork this repository and issue a pull request.Pre-commithooks are provided, please check code against these before submitting.
Install with:pre-commit installHistory0.3.0 (2019-07-30)Add wrapper to run DAWNAdd wrapper to run Jupyter notebooks0.2.0 (2019-07-30)Publish zocalo-dls to pypi.orgAdd ISPyB service0.1.0 (2019-07-30)Working to set this package up with best practices for Diamond teams to followGeneric wrapper for GDA tasks
Package: zocrypt
ZocryptIntended mainly for use byZeroAndOne Developersfor protection of
data with 6 level encryption.Based on our projectsecret message encoder
decoderInstallingpip install zocryptUsage>>> from zocrypt import encrypter,decrypter,key
>>> text="5 Mangoes are better than 6 Mangoes"
>>> key=key.generate()
>>> encryptedtext=encrypter.encrypt_text(text,key)
'`"V`O/i|;^a^.~k|4~k|;a|R#`k|l`V~#^#^V~Hk~V|l/a|k^"~V/O/i^;|a^.`k3'
>>> decrypter.decrypt_text(encryptedtext,key)
'5 Mangoes are better than 6 Mangoes'
Package: zodb-cm
ZODB context managerInstallationpip install zodb-cmZConnection()Provides a ZODB connection with auto-abort (default).Provides a tuple of connection and root object:with ZConnection(db) as cx, root:
          root.one = "ok"ZConnection implements a connection context manager.Transaction context managers in contrast do auto-commit:with db.transaction() as connection, orwith cx.transaction_manager as transaction, orwith transaction.manager as transaction  (for the thread-local transaction manager)See alsohttp://www.zodb.org/en/latest/guide/transactions-and-threading.htmlZDatabase()Provides a ZODB database context manager.Change History0.1.0 (2021-02-17)Package creation
Package: zodb.py3migrate
zodb.py3migrate - ZODB and Python 3If you have aZODBdatabase written using Python 2.x this package helps you to
get your database ready for using it with Python 3. It is able to:display objects which need to be converted,do most of the the conversion for you,and switch the database file to be readable in a process running Python 3.This package is compatible with Python version 2.7.The documentation is athttps://zodbpy3migrate.readthedocs.io.DevelopingAuthor:gocept<mail@gocept.com>Online documentation:http://zodbpy3migrate.readthedocs.io/PyPI page:https://pypi.python.org/pypi/zodb.py3migrateIssues:https://github.com/gocept/zodb.py3migrate/issuesSource code:https://github.com/gocept/zodb.py3migrateCurrent change log:https://raw.githubusercontent.com/gocept/zodb.py3migrate/master/CHANGES.rstChange log0.6 (2018-06-05)Update requirements toZODB >= 4as with an older version the migration
cannot be done successfully.
(#13)0.5 (2017-01-17)Release as wheel and include all files in release.Ensure compatibility withsetuptools >= 30.0.4 (2016-10-29)Fix brown bag release.0.3 (2016-10-29)Fixes for issues #4 and #5: Converted ZODB ist now actually saved,
using additional subtransactions improves the memory footprint.0.2 (2016-06-08)Split up the two functions previously united in the scriptbin/zodb-py3migrateintobin/zodb-py3migrate-analyzeresp.bin/zodb-py3migrate-convert.Add new options to the analysis script:--startto start the analysis with a predefined OID.--limitto stop the analysis after a certain amount of seen OIDs.0.1 (2016-05-19)Initial release.
Package: zodbshootout
This application measures and compares the performance of various
ZODB storages and configurations. It is derived from the RelStorage
speedtest script, but this version allows arbitrary storage types and
configurations, provides more measurements, and produces numbers that
are easier to interpret.DocumentationDocumentationincludinginstallation instructionsis hosted onreadthedocs.The completechangelogis also there.Developmentzodbshootout is hosted at GitHub:https://github.com/zodb/zodbshootout
Package: zodburi
A library which parses URIs and converts them to ZODB storage objects and
database arguments.See the documentation athttps://docs.pylonsproject.org/projects/zodburi/en/latest/for more information.Change Log2.6.0 (2023-05-17)Stop support for ZODB4Stop support for python<3.72.5.0 (2021-05-12)Support both ZODB4 and ZODB5.Add support for PyPy.Add support for Python 3.8.Drop support for Python 3.4.Add support fordemo:URI scheme.2.4.0 (2019-01-11)Add support for Python 3.7.Fix PendingDeprecationWarning aboutcgi.parse_qsl. (PR #21)2.3.0 (2017-10-17)Fix parsing ofzeo://URI with IPv6 address.Drop support for Python 3.3.Add support for Python 3.6.2.2.2 (2017-05-05)Fix transposedinstall_requiresandtests_requirelists insetup.py.2.2.1 (2017-04-18)Fix breakage added in 2.2 to thezconfigresolver.2.2 (2017-04-17)Add support for additional database configuration parameters:pool_timeout,cache_size_bytes,historical_pool_size,historical_cache_size,historical_cache_size_bytes,historical_timeout, andlarge_record_size.2.1 (2017-04-17)Add support for Python 3.4 and 3.5.Drop support for Python 2.6 and 3.2.Add missing ClientStorage constructor kw args to resolver.2.0 (2014-01-05)UpdateZODB3meta-package dependency toZODB+ZConfig+ZEO.
Those releases are what we import, and have final Py3k-compatible releases.Packaging:  fix missingurlargument tosetup().2.0b1 (2013-05-02)Add support for Python 3.2 / 3.3.Addsetup.py docsalias (runssetup.py developand installs
documentation dependencies).Addsetup.py devalias (runssetup.py developand installs
testing dependencies).Automate building the Sphinx docs viatox.Fixzconfig:URIs under Python 2.7.  The code worked around a bug in
the stdlib’surlparse.urlsplitfor Python < 2.7; that workaround broke
under 2.7.  Seehttps://github.com/Pylons/zodburi/issues/5Drop support for Python 2.5.1.1 (2012-09-12)Remove support forpostgres://URIs, which will now be provided by
therelstoragepackage.  Thanks to Georges Dubus for the patch!1.0 (2012-06-07)Add support forpostgres://URIs.  Thanks to Georges Dubus for
the patch!Pin dependencies to Python 2.5-compatible versions when testing with
tox under Python 2.5.Update the documentation for publication toReadTheDocs1.0b1 (2011-08-21)Initial release.