Saravanan666/pypi-org huggingface dataset:
Package: shaped-nujson
nujson: The UltraJSON Fork That Supports Numpy Serialization That Actually Includes Python WheelsInspired byPandas' ujsonHow to installExampleWhy make such a package and what is modifiedHow to installPython versions: Python 3.5+Using pip:pipinstallshaped-nujsonIf you get an error like this:ERROR: Could not find a version that satisfies the requirement numpy>=1.16.4 (from nujson) (from versions: 1.9.3)
ERROR: No matching distribution found for numpy>=1.16.4 (from nujson)Try this:pipuninstallnumpy
pipinstallnumpy==1.16.4
pipinstallshaped-nujsonExample>>>importnumpyasnp>>>importnujsonasujson>>>a={"a":np.int64(100)}>>>ujson.dumps(a)'{"a":100}'>>>a["b"]=np.float64(10.9)>>>ujson.dumps(a)'{"a":100,"b":10.9}'>>>a["c"]=np.str_("12")>>>ujson.dumps(a)'{"a":100,"b":10.9,"c":"12"}'>>>a["d"]=np.array(list(range(10)))>>>ujson.dumps(a)'{"a":100,"b":10.9,"c":"12","d":[0,1,2,3,4,5,6,7,8,9]}'>>>a["e"]=np.repeat(3.9,4)>>>ujson.dumps(a)'{"a":100,"b":10.9,"c":"12","d":[0,1,2,3,4,5,6,7,8,9],"e":[3.9,3.9,3.9,3.9]}'Why make such a package and what is modified?On Python 3, some data types of NumPy are not serializable. Here are some references:python - Why are some numpy datatypes JSON serializable and others not? - Stack OverflowMaximum recursion level reached in Python 3 - Issue #221 - esnme/ultrajsonIssue 24313: json fails to serialise numpy.int64 - Python trackerOne solution is type conversion like:int(numpy.int64)andnumpy.array.tolist().
But it's not good for performance. After searching the Internet, we found an unmaintained projectKomnomnomnom/ultrajsonwhich recommends to usePandas' ujson.We tried but found Pandas is too heavy for our projects. So we decided to build our own lightweight fork. Currently, esn's ujson master branch has some problems we needed to solve, and themasterbranch is based on thethe v1.35 ujson.The main point is to convert NumPy data types in C, with calling NumPy's header.Commit 187bd15has the most changes we made to support NumPy, andcommit afedc42fixes a build issue on macOS caused by Clang.
Package: shape-existence
shape_existenceThis is a package to prove the existence of non-intersecting realizations of abstract simplicial complexes with specified edge lengths.This README should be fleshed out soon, for now here are the test cases fromshape_existence.py.if __name__ == '__main__':
    examples = [4]
    if 1 in examples:
        #tetrahedron
        tetrahedron_asc = AbstractSimplicialComplex(mode = "maximal_simplices", data = [["a", "b", "c", "d"]])
        tetrahedron_rsc = tetrahedron_asc.heuristic_embed(dim = 3, desired_sq_lengths = {"default" : 1}, final_round_digits = 5)
        tetrahedron_rsc.save_as_obj("tetrahedron.obj", "./obj_files/")
        tetrahedron_rsc.prove_existence(desired_sq_lengths = {"default" : Fraction(1)}, verbose = True)
    if 2 in examples:
        #octahdron
        octahedron_asc = AbstractSimplicialComplex(mode = "maximal_simplices", 
                                                   data = [["t", "1", "2"], ["t", "2", "3"], ["t", "3", "4"], ["t", "4", "1"],
                                                           ["b", "1", "2"], ["b", "2", "3"], ["b", "3", "4"], ["b", "4", "1"]]) 
        octahedron_rsc = octahedron_asc.heuristic_embed(dim = 3, desired_sq_lengths = {"default" : 1}, final_round_digits = 5)
        octahedron_rsc.save_as_obj("octahedron.obj", "./obj_files/")
        octahedron_rsc.prove_existence(desired_sq_lengths = {"default" : Fraction(1)}, verbose = True)
    if 3 in examples:
        #icosahedron
        icosahedron_asc = AbstractSimplicialComplex(mode = "maximal_simplices",
                                                    data = [["t", "a1", "a2"], ["t", "a2", "a3"], ["t", "a3", "a4"], ["t", "a4", "a5"], ["t", "a5", "a1"],
                                                            ["a1", "a2", "b1"], ["a2", "a3", "b2"], ["a3", "a4", "b3"], ["a4", "a5", "b4"], ["a5", "a1", "b5"],
                                                            ["b1", "b2", "a2"], ["b2", "b3", "a3"], ["b3", "b4", "a4"], ["b4", "b5", "a5"], ["b5", "b1", "a1"],
                                                            ["b", "b1", "b2"], ["b", "b2", "b3"], ["b", "b3", "b4"], ["b", "b4", "b5"], ["b", "b5", "b1"]])
        icosahedron_rsc = icosahedron_asc.heuristic_embed(dim = 3, desired_sq_lengths = {"default" : 1}, final_round_digits = 9)
        icosahedron_rsc.save_as_obj("icosahedron.obj", "./obj_files/")
        icosahedron_rsc.prove_existence(desired_sq_lengths = {"default" : Fraction(1)}, verbose = True)
    if 4 in examples:
        #existence of a triangle with sides 3, 4, and 5
        right_triangle = AbstractSimplicialComplex(mode = "maximal_simplices", 
                                                  data = [["a", "b"], ["b", "c"], ["c", "a"]])
        right_triangle_rsc = right_triangle.heuristic_embed(dim = 2, desired_sq_lengths = {("a", "b") : 9, ("b", "c") : 16, ("c", "a") : 25}, final_round_digits = 8)
        right_triangle_rsc.save_as_obj("345_triangle.obj", "./obj_files/")
        right_triangle_rsc.prove_existence(desired_sq_lengths = {("a", "b") : 9, ("b", "c") : 16, ("c", "a") : 25}, verbose = True)
Package: shapefile-to-sqlite
shapefile-to-sqliteLoad shapefiles into a SQLite (optionally SpatiaLite) database.Project background:Things I learned about shapefiles building shapefile-to-sqliteHow to install$ pip install shapefile-to-sqliteHow to useYou can run this tool against a shapefile file like so:$ shapefile-to-sqlite my.db features.shpThis will load the geometries as GeoJSON in a text column.Using with SpatiaLiteIf you haveSpatiaLiteavailable you can load them as SpatiaLite geometries like this:$ shapefile-to-sqlite my.db features.shp --spatialiteThe data will be loaded into a table calledfeatures- based on the name of the shapefile. You can specify an alternative table name using--table:$ shapefile-to-sqlite my.db features.shp --table=places --spatialiteThe tool will search for the SpatiaLite module in the following locations:/usr/lib/x86_64-linux-gnu/mod_spatialite.so/usr/local/lib/mod_spatialite.dylibIf you have installed the module in another location, you can use the--spatialite_mod=xxxoption to specify where:$ shapefile-to-sqlite my.db features.shp \
    --spatialite_mod=/usr/lib/mod_spatialite.dylibYou can use the--spatial-indexoption to create a spatial index on thegeometrycolumn:$ shapefile-to-sqlite my.db features.shp --spatial-indexYou can omit--spatialiteif you use either--spatialite-modor--spatial-index.ProjectionsBy default, this tool will attempt to convert geometries in the shapefile to the WGS 84 projection, for best conformance with theGeoJSON specification.If you want it to leave the data in whatever projection was used by the shapefile, use the--crs=keepoption.You can convert the data to another output projection by passing it to the--crsoption. For example, to convert toEPSG:2227(California zone 3) use--crs=espg:2227.The full list of formats accepted by the--crsoption isdocumented here.Extracting columnsIf your data contains columns with a small number of heavily duplicated values - the names of specific agencies responsible for parcels of land for example - you can extract those columns into separate lookup tables referenced by foreign keys using the-coption:$ shapefile-to-sqlite my.db features.shp -c agencyThis will create aagencytable withidandnamecolumns, and will create theagencycolumn in your main table as an integer foreign key reference to that table.The-coption can be used multiple times.CPAD_2020a_Unitsis an example of a table created using the-coption.
Package: shapeGMM
GMM PositionsOverviewThis is a package to perform Gaussian Mixture Model (GMM) clustering on particle positions (in). Like other GMM schemes, the user must specify the number of clusters and a cluster initialization scheme (defaults to random).  This is specified in the object initialization line, analagous to how it is done for the sklean GaussianMixture package.  There are two choices for the form of the covariance but those are specified by calling different fit functions.  See preprint (https://arxiv.org/abs/2112.11424) for additional details.InstallationThe package can be installed using pippip install shapeGMMor downloaded and installed withpython setup.py installUsageThis package is designed to mimic the usage of the sklearn package.  You first initiliaze the object and then fit.  Predict can be done once the model is fit.  Fit and ppredict functions take particle position trajectories as input in the form of a (n_frames, n_atoms, 3) numpy array.Initialize:from shapeGMM import gmm_shapessgmm_object = gmm_shapes.ShapeGMM(n_clusters,verbose=True)Fit:Uniform (spherical, uncorrelated) covariance:aligned_trajectory = sgmm_object.fit_uniform(training_set_positions)Weighted (Kronecker product) covariance:aligned_trajectory = sgmm_object.fit_weighted(training_set_positions)Predict:Uniform (spherical, uncorrelated) covariance:clusters, aligned_traj, log_likelihood = sgmm_object.predict_uniform(full_trajectory_positions)Weighted (Kronecker product) covariance:clusters, aligned_traj, log_likelihood = sgmm_object.predict_weighted(full_trajectory_positions)Description of ContentsTest Cases
Package: shapeguard
Shape GuardShapeGuard is a tool to help with handling shapes in Tensorflow.Basic UsageimporttensorflowastffromshapeguardimportShapeGuardsg=ShapeGuard()img=tf.ones([64,32,32,3])flat_img=tf.ones([64,1024])labels=tf.ones([64])# check shape consistencysg.guard(img,"B, H, W, C")sg.guard(labels,"B, 1")# raises error because of rank mismatchsg.guard(flat_img,"B, H*W*C")# raises error because 1024 != 32*32*3# guard also returns the tensor, so it can be inlinedmean_img=sg.guard(tf.reduce_mean(img,axis=0),"H, W, C")# more readable reshapesflat_img=sg.reshape(img,'B, H*W*C')# evaluate templatesassertsg['H, W*C+1']==[32,97]# attribute access to inferred dimensionsassertsg.B==64Shape Template SyntaxThe shape template mini-DSL supports many different ways of specifying shapes:numbers:"64, 32, 32, 3"named dimensions:"B, width, height2, channels"wildcards:"B, *, *, *"ellipsis:"B, ..., 3"addition, subtraction, multiplication, division:"B*N, W/2, H*(C+1)"dynamic dimensions:"?, H, W, C"(only matches[None, H, W, C])DISCLAIMERThis is not an officially supported Google product.
Package: shapeit
Shapelyis
great for working with geometries, but if you’re dealing with Geographic
Information Systems
(GIS)
there are times when you really need your geometries to have some
awareness ofspatial
reference.
This project seeks to combineShapelywithpyprojand some other
conveniences to make working with geometries across spatial references
easy and fun!Project Featuresshapeitautomated unit tests you can run withpytestaSphinxdocumentation
projectGetting StartedThe project’s documentation contains a section to help youget
startedas a developer or user of the library.ExamplesWGS84 to UTMIn this example we’ll start with a latitude and a longitude and create a
point that happens to be inUTM zone
15N(32615). We’ll
then use theas_utmmethod to create the equivalent point in the UTM
coordinate system.fromshapeitimportSrPoint# Create a point from a latitude, longitude.wgs84=SrPoint.from_lat_lon(lat=45.553670,lon=-94.142430)# Convert it to UTM.utm=wgs84.as_utm()# What are the coordinates of the UTM point?print(f'x={utm.x}, y={utm.y}')# What's the SRID of the UTM point's coordinate system.print(f"The UTM SRID is:{utm.srid}")x=410830.5412685075,y=5045093.805781859TheUTMSRIDis:32615For more examples and other information, visit thedocumentation
page.Development PrerequisitesIf you’re going to be working in the code (rather than just using the
library), you’ll want a few utilities.GNU MakePandocResourcesBelow are some handy resource links.Project DocumentationClickis a Python package for
creating beautiful command line interfaces in a composable way with
as little code as necessary.Sphinxis a tool that
makes it easy to create intelligent and beautiful documentation,
written by Geog Brandl and licnsed under the BSD license.pytesthelps you write
better programs.[GNU Make] is a tool which controls the generation of executables and
other non-source files of a program from the program’s source files.AuthorsPat Daburu-Initial work-githubSee also the list ofcontributorswho
participated in this project.LicenseMIT LicenseCopyright (c) patdaburuPermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: shapelib
Python utilities to facilitate working with shapely (shape creation, rasterization, plotting)Free software: BSD licenseDocumentation:http://shapelib.rtfd.org.Featuresprovides easy methods to interact with shapely and other related librarieseasy creation of complex geometric shapesgeometric operations:
- extend line
- extrapolate points
- generate perpendicular lines
- calculate angles
- find the nearest points between two geometriesrasterization
- convert a shape to an array
- convert a shape to a picture
- plot a complex shape with matplotlibIncentiveshapelib started as a set of utilities to build geometric shapes as part of acoustic simulations (walls, ducts, tubes). It proved to be useful outside of this specific domain.History0.1.0 (2014-01-11)First release on PyPI.
Package: shapelyAcad
easily draw shapely objects in autocadEasily draw shapely objects in autocad by usingpyautocad.InstallationpipinstallshapelyAcadWarning if you use this project make sure to pin the version, api is far from stable!Usage:fromshapely.geometryimportPoint,LineStringfromshapelyAcadimportShapelyAcads_acad=ShapelyAcad()# draw point in AutoCADpoint=Point([6,3])s_acad.draw_shapely(point)s_acad.draw_text("Sample Text",point)# draw line in AutoCAD# line = LineString([[3, 0], [3, 10], [3, 20], [3, 30]])line=LineString([[3,0,0],[3,10,0],[3,20,0],[3,30,0]])s_acad.draw_shapely(line,color=3)s_acad.draw_profile(line,5,10)# select objects from AutoCADlist_of_shapley_objects=s_acad.get_shapelies_from_selection()ContributeFeel free to do some black math magic, add test or make suggestions.Requirementspyproject.toml to manage requirements and can be build by a newer build backend.Build and TestInstall MakeFile for quality of lifeAfter setting up a venv we usemake installto build a fresh pulled repoCode quality checks and testing needs to be passed and will be checked on every commit and in the pipeline. If code wont pass it wont commit so make sure to check it before with make check-all!We use:flit as a build-backend.pytest for testing, manual bymake testin a console.flake8 and black for linting, manual bymake lintin a console.myPy for typechecking, manual bymake typecheckin a console.black and isort, manual bymake formatin a console.bumpversion for changing the versionTestingMake an effort to test each bit of functionality you add. Try to keep it simple.Linksmakeflake8blackmyPyiSortflitbumpversion
Package: shapely-ext
shapely_extIt's a shapely extension package for shapely user.
shapely_ext provides lots of magic util based on shapely, including interpolate, mesh, space explore,
angle and decompositioninstallpip install shapely_extcatalogTODOTODOwrite a tutorialrefactor space explorerimplement a magic snap functionimplement filling utilimplement cutting utilhow to get mid line of gap between several big polygonsadd intersects checker for linestring
Package: shapelyutils
See CHANGELOG.md for news.How to usepipenv install shapelyutilsCreating python packagesIt is really super easy.Use pipenvpipenv install --dev pylintpipenv install --dev pytestPut your source files in a directory that matches the package. Yes this may give an annoying myproject/myproject/myproject.py hierarchy. Deal with it.Create a README.md a LICENSE file and a CHANGELOG.mdCopy-paste setup.py and modify to fit your own use. Don't worry much about the requirements there.To add circleci integration to your project, just copy paste the .circleci/config.yml file.Remember to add and commit Pipfile, .circleci/config etc.PublishPyPI Package: (shapelyutils)[https://pypi.org/project/shapelyutils/]Change the version insetup.pypipenv run python setup.py sdist bdist_wheelFollow thisinstructionto create a token for publishing.twine upload --repository testpypi dist/*
Package: shape-merge
Shape-MergeA Python based GIS library for finding and merging all Geometries that intersects with their neighbour.
The library will iterate over all the geometries provided in the form of followingInputs,
and will look for the neighbours which forms an intersection relationship with itsParentthe geometry that looks for intersection is reffered as Parenteither through a direct intersection or an intersection link generated via multipleChildgeometries which have a relationship associated with its Parent either as a direct neighbour or via mutiple neighbour is reffered to as a Childintersection.Installationpip install shape-mergeRequirementsThe library usesRtreewhich has a dependency onlibspatialindex,
It is recommend to resolving the dependency throughlibspatialindex condaLibSpatialIndex For Linux:$ sudo apt-get update -y
$ sudo apt-get install -y libspatialindex-devLibSpatialIndex For Windows:Experience is pretty grim for Windows Installation, i used conda for trouble free installation.Rtreeconda install -c conda-forge rtreeFionaconda install -c conda-forge fionaInputsShapeFilefromshape_merge.mergeimportShapeMergeshape_merge=ShapeMerge()shape_merge.populate_index_by_fiona(r"path_to_shape_file.shp")GeoJSONfromshape_merge.mergeimportShapeMergeshape_merge=ShapeMerge()shape_merge.populate_index_by_geojson(r"path_to_geo_json.geojson")Iterativelypopulate theindexfromshape_merge.mergeimportShapeMergeshape_merge=ShapeMerge()forfeatureinfeature_collection:shape_merge.populate_index_by_feature(feature)Feature must be of the following structure:{'type': 'Feature', 'id': str, 'properties': dict, 'geometry': {'type': 'GeometryType', 'coordinates': list}}How to runAfter Populating the Index, merging is matter of a function call away, execute the following to begin merging:shape_merge.merge_geometries()OutputThe Output will be a collection, which will contain the merged geometries and the all the ids that were merged togethermerged_geoemrty = OrderedDict([(0, {'ids': [ ], 'geometry': {'type': 'GeometryType', 'coordinates': []}})])Parametersbounds_buffer:During rtree index creation the bounds of individual geometry are added with buffer of 0,
This param controls on how big the original bounds should grow.geometry.bounds.buffer(self.__bounds_buffer)The bounds of the geometry are responsible for finding potential intersecting neighbour
i.e everything that lies in the bound is considered as a potential neighbour. A large value of bound value will
increase the computational overhead.geometry_buffer:Add buffer to geometries while checking if they intersect with each othergeometry_1.buffer(self.__geometry_buffer).intersects(geometry_2.buffer(self.__geometry_buffer))
Package: shapeout
Shape-Out is a graphical user interface for the analysis
and visualization of RT-DC data sets. For more information please visithttps://zellmechanik.com/.Please consider migrating your analysis pipeline toShape-Out 2.The differences between Shape-Out 1 and Shape-Out 2 are discussedin the Shape-Out 2 docs.DocumentationThe documentation is available athttps://shapeout.readthedocs.io.InstallationInstallers for Shape-Out are available at therelease page.Citing Shape-OutPlease cite Shape-Out either in-line(...) using the analysis software Shape-Out version X.X.X (available at
https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut).or in a bibliographyPaul Müller and others (2015), Shape-Out version X.X.X: Analysis software
for real-time deformability cytometry [Software]. Available at
https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut.and replaceX.X.Xwith the version of Shape-Out that you used.DevelopmentDetails on running Shape-Out from source, contributing, testing, and releasing new versions
of Shape-Out can be found athttps://github.com/ZELLMECHANIK-DRESDEN/ShapeOut/tree/develop/DEVELOP.rst.
Package: shapeout2
Shape-Out 2is the successor ofShape-Out,
a graphical user interface for the analysis and visualization of RT-DC data sets.
For more information please visithttps://zellmechanik.com/.DocumentationThe documentation, including the code reference and examples, is available atshapeout2.readthedocs.io.InstallationInstallers for Windows and macOS are available at therelease page.If you have Python 3 installed, you can install Shape-Out 2 withpip install shapeout2Citing Shape-OutPlease cite Shape-Out either in-line(...) using the analysis software Shape-Out version 2.X.X (available at
https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut2).or in a bibliographyPaul Müller and others (2019), Shape-Out version 2.X.X: Analysis software
for real-time deformability cytometry [Software]. Available at
https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut2.and replace2.X.Xwith the version of Shape-Out that you used.Testingpip install -e .
pip install -r tests/requirements.txt
pytest tests
Package: shapes
# shapesshapes is a Python package for traditional and geometric morphometrics.It can be used in a Python interpretator, or in a GUI online at [PhyloNimbus.com](http://www.phylonimbus.com/morphometrics/), where you can also digitize landmarks.Uses include:* Procrustes superimposition.* Missing landmark estimation.## Installationshapes can be installed from the Python Package Index:`pip install shapes`## UsageRead files from Landmark editor:```import shapeslms = shapes.read('/path/to/file')```This returns a Shape object for that specimen.Shape objects can be combined into ShapeSets:```shapeset = shapes.ShapeSet(name="Theropod skulls")shapeset.append_shape(lms)```Once you've added all relevant Shapes to a ShapeSet, the landmarks can bealigned using[Procrustes Analysis](https://en.wikipedia.org/wiki/Procrustes_analysis):```aligned_shapeset = shapes.procrustes_align(shapeset)```Note that this Procrustes alignment will work even if some landmarks are missing(in which case alignment will be based solely on the non-missing landmarks).This could lead to systematic biases in your dataset depending on thedistribution of missing data. *Caveat emptor...*Once the data set has been aligned as in the previous step, missing data canbe interpolated using one of two methods.Using symmetry (for landmarks that are part of symmetrical pairs):```paired_landmarks = [(1,4),(2,5),(3,6)]symmetrically_reconstructed = shapes.missing.estimate_from_symmetry(aligned_shapeset,paired_landmarks)```Or using the mean of the aligned homologous landmark in specimens where it ispresent:```mean_reconstructed = shapes.missing.estimate_from_mean(aligned_shapeset)```Landmarks from all Shapes in a ShapeSet can be exported to csv:```aligned_shapeset.export('output_file.csv')```## Licenseshapes is available under the MIT license.## More information and citationWhite, D.E. (2016) Chapter 3 *of* The Evolution and Phylogenetic Analysis ofthe Dinosaur Axial Skeleton. PhD Dissertation, George Washington University.