Saravanan666/pypi-org huggingface dataset:
Package: pylsd-nova
pylsd-nova1. Introductionpylsd-nova is a python binding forLSD - Line Segment Detector.This is a fork from originalpylsd binding. This fork works for Python 3 and adds the ability to change lsd parameters from python call.2. InstallThis package uses distutils, which is the default way of installing python modules. For installing by cloning the repository you can run the following commands:git clone https://github.com/AndranikSargsyan/pylsd-nova.git
cd pylsd-nova
pip install .Or install directly throughpip:pip install pylsd-nova3. UsageYou can use the package by importing likefrom pylsd import lsd, and callingsegments = lsd(img)by optionally passing other lsd parameters mentioned below.imgis a Grayscale Image (H x Wnumpy.ndarray), and the return valuesegmentscontains detected line segments.segmentsis anN x 5numpy.ndarray. Each row represents a straight line. The 5-dimensional row format is:[point1.x, point1.y, point2.x, point2.y, width]These are the parameters of lsd, which can be changed through keyword arguments of lsd call:scale (float): Scale the image by Gaussian filter to 'scale'.sigma_scale (float): Sigma for Gaussian filter is computed assigma = sigma_scale / scale.quant (float): Bound to the quantization error on the gradient norm.ang_th (float): Gradient angle tolerance in degrees.eps (float): Detection threshold,-log10(NFA).density_th (float): Minimal density of region points in rectangle.n_bins (int): Number of bins in pseudo-ordering of gradient modulus.max_grad (float): Gradient modulus in the highest bin. The default value corresponds to the highest gradient modulus on images with gray levels in [0,255].You can use it just like the following code (here is the link to examples):by using cv2 moduleimportcv2importnumpyasnpimportosfrompylsdimportlsdfull_name='car.jpg'folder,img_name=os.path.split(full_name)img=cv2.imread(full_name,cv2.IMREAD_COLOR)img_gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)segments=lsd(img_gray,scale=0.5)foriinrange(segments.shape[0]):pt1=(int(segments[i,0]),int(segments[i,1]))pt2=(int(segments[i,2]),int(segments[i,3]))width=segments[i,4]cv2.line(img,pt1,pt2,(0,0,255),int(np.ceil(width/2)))cv2.imwrite(os.path.join(folder,'cv2_'+img_name.split('.')[0]+'.jpg'),img)by using PIL(Image) moduleimportnumpyasnpimportosfromPILimportImage,ImageDrawfrompylsdimportlsdfull_name='house.png'folder,img_name=os.path.split(full_name)img=Image.open(full_name)img_gray=np.asarray(img.convert('L'))segments=lsd(img_gray,scale=0.5)draw=ImageDraw.Draw(img)foriinrange(segments.shape[0]):pt1=(int(segments[i,0]),int(segments[i,1]))pt2=(int(segments[i,2]),int(segments[i,3]))width=segments[i,4]draw.line((pt1,pt2),fill=(0,0,255),width=int(np.ceil(width/2)))img.save(os.path.join(folder,'PIL_'+img_name.split('.')[0]+'.jpg'))The following is the result:car.jpg by using cv2 modulehouse.png by using PIL(Image) module
Package: pylsd-nova-mac-arm
pylsd-nova1. Introductionpylsd-nova is a python binding forLSD - Line Segment Detector.This is a fork from originalpylsd binding. This fork works for Python 3 and adds the ability to change lsd parameters from python call.2. InstallThis package uses distutils, which is the default way of installing python modules. For installing by cloning the repository you can run the following commands:git clone https://github.com/AndranikSargsyan/pylsd-nova.git
cd pylsd-nova
pip install .Or install directly throughpip:pip install pylsd-nova3. UsageYou can use the package by importing likefrom pylsd import lsd, and callingsegments = lsd(img)by optionally passing other lsd parameters mentioned below.imgis a Grayscale Image (H x Wnumpy.ndarray), and the return valuesegmentscontains detected line segments.segmentsis anN x 5numpy.ndarray. Each row represents a straight line. The 5-dimensional row format is:[point1.x, point1.y, point2.x, point2.y, width]These are the parameters of lsd, which can be changed through keyword arguments of lsd call:scale (float): Scale the image by Gaussian filter to 'scale'.sigma_scale (float): Sigma for Gaussian filter is computed assigma = sigma_scale / scale.quant (float): Bound to the quantization error on the gradient norm.ang_th (float): Gradient angle tolerance in degrees.eps (float): Detection threshold,-log10(NFA).density_th (float): Minimal density of region points in rectangle.n_bins (int): Number of bins in pseudo-ordering of gradient modulus.max_grad (float): Gradient modulus in the highest bin. The default value corresponds to the highest gradient modulus on images with gray levels in [0,255].You can use it just like the following code (here is the link to examples):by using cv2 moduleimportcv2importnumpyasnpimportosfrompylsdimportlsdfull_name='car.jpg'folder,img_name=os.path.split(full_name)img=cv2.imread(full_name,cv2.IMREAD_COLOR)img_gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)segments=lsd(img_gray,scale=0.5)foriinrange(segments.shape[0]):pt1=(int(segments[i,0]),int(segments[i,1]))pt2=(int(segments[i,2]),int(segments[i,3]))width=segments[i,4]cv2.line(img,pt1,pt2,(0,0,255),int(np.ceil(width/2)))cv2.imwrite(os.path.join(folder,'cv2_'+img_name.split('.')[0]+'.jpg'),img)by using PIL(Image) moduleimportnumpyasnpimportosfromPILimportImage,ImageDrawfrompylsdimportlsdfull_name='house.png'folder,img_name=os.path.split(full_name)img=Image.open(full_name)img_gray=np.asarray(img.convert('L'))segments=lsd(img_gray,scale=0.5)draw=ImageDraw.Draw(img)foriinrange(segments.shape[0]):pt1=(int(segments[i,0]),int(segments[i,1]))pt2=(int(segments[i,2]),int(segments[i,3]))width=segments[i,4]draw.line((pt1,pt2),fill=(0,0,255),width=int(np.ceil(width/2)))img.save(os.path.join(folder,'PIL_'+img_name.split('.')[0]+'.jpg'))The following is the result:car.jpg by using cv2 modulehouse.png by using PIL(Image) module
Package: pylsewave
pylsewaveRepository structure.
+--doc# documentation directory+--JupyterNbs# jupyter notebooks+--data# input data for case studies+--pylsewave# the package directory (contains all modules)+--test# unit test files+.README.md
+.LICENCE
+.setup.py
+.pyproject.toml
+.Adan_77_example.py# case study for a whole arterial network (linear-elastic arterial walls)+.vtk_example.py(examplewithvtk)A Python package to solve pulse wave dynamics in arterial networksThe following diagram depicts the rationale along with the structure of the packageA c/python library to solve 1D pulse wave propagation in blood vessels or any hyperbolic PDE system in the form ofPurposeThis library is designed to solve efficiently pulse wave dynamics in human arteries. It is written in python, cython and there are some bits of C++.Install pylsewaveTo install pylsewave toolkit, use pip:pip install pylsewaveRun the exampleThere are two examples in this directory:Adan_77_example.pyTo run the case go to the top level directory of the repository and type:pythonAdan_77_example.py-ivesseldatafiledata\Arterial_Network_ADAN56.txt-ibcinflowfiledata\inflow_Aorta.txt-oresfilearterial_network_77_vessels-languagepyNOTE: You can execute the file with python classes translated via cython by changing the -language py to -language cy.vtk_example.pyThis is an example for storing the results in vtk multiblock file. The user should install pyvtk first (it can be found onPYPI).pythonvtk_example.py-resfile<resfile>-ovisfile<visfile>Examples in Jupyter notebooksThere are several case studies in jupyter notebooks underJupyterNbsdirectory. To run the cases, the user should install jupyter either with conda or pip (see the latest install instructions`` inJupyter documentaion):condacondainstalljupyterpippipinstalljupyterBuild the docsTo build the documentation, under thedocsdirectory type (you will need sphinx):makehtmlCite pylsewavePrefered citation style for pylsewave:Georgios E. Ragkousis (2019). PylseWave: A python package to solve pulse wave dynamics in arterial networks. Zenodo.
Package: py-lsh
LSHashA fast Python implementation of locality sensitive hashing.I am usinghttps://github.com/kayzhu/LSHash, but it stops to update since 2013.So I maintain it myself.HighlightsFast hash calculation for large amount of high dimensional data through the use ofnumpyarrays.Built-in support for persistency through Redis.Multiple hash indexes support.Built-in support for common distance/objective functions for ranking outputs.InstallationLSHashdepends on the following libraries:numpyredis (if persistency through Redis is needed)bitarray (if hamming distance is used as distance function)To install:$pipinstalllshashQuickstartTo create 6-bit hashes for input data of 8 dimensions:frompy_lshimportLSHashlsh=LSHash(6,8)lsh.index([1,2,3,4,5,6,7,8])lsh.index([2,3,4,5,6,7,8,9])lsh.index([10,12,99,1,5,31,2,3])lsh.query([1,2,3,4,5,6,7,7])[((1, 2, 3, 4, 5, 6, 7, 8), 1.0),
((2, 3, 4, 5, 6, 7, 8, 9), 11)]Main InterfaceTo initialize aLSHashinstance:LSHash(hash_size,input_dim,num_of_hashtables=1,storage=None)parameters:hash_size: The length of the resulting binary hash.input_dim: The dimension of the input vector.num_hashtables = 1: (optional) The number of hash tables used for multiple lookups.storage = None: (optional) Specify the name of the storage to be used for the index storage. Options include "redis".To index a data point of a givenLSHashinstance, e.g.,lsh:lsh.index(input_point,extra_data=None)parameters:input_point: The input data point is an array or tuple of numbers of input_dim.extra_data = None: (optional) Extra data to be added along with the input_point.To query a data point against a givenLSHashinstance, e.g.,lsh:lsh.query(query_point,num_results=None,distance_func="euclidean")parameters:query_point: The query data point is an array or tuple of numbers of input_dim.num_results = None: (optional) The number of query results to return in ranked order. By default all results will be returned.distance_func = "euclidean": (optional) Distance function to use to rank the candidates. By default euclidean distance function will be used.
Package: pyls-livepy
A realtime debugging and testing plugin for thePython Language Server(pylsp).Who is it for?Anyone who creates/maintains projects in Python.Why?Debugging and testing tends to be fairly separate from editing code. Typically a developer needs to run tests each time changes are made and a file saved, and start a debug session when a non-obvious error is found. This slows down the development process considerably.This plugin uses features provided by thelanguage server protocol(LSP) - as implemented in pylsp - to run tests and provide debugging data* whenever code is updated, making the debug+test feedback process realtime.How can I start using it?Install pylsp into an IDE with LSP support (instructions).Install pyls-livepy into pylsp, specifying the “pyls” extra.pip install pyls-livepy[pyls]Ensure your project has a pyproject.toml file created withpoetry.Install pyls-livepy into the project, specifying the “runs” extra.poetry add --dev pyls-livepy[runs]Installnox(with toml) so it can be ran from within the project (globally is recommended).Open a Python project file in the editor to ensure pyls-livepy is detected, and to generate thenoxconfig.Runnoxat least once to create the project’s environment.Write doctests and pytest cases** as you write your code; any failing/throwing tests will be marked.To disable per project, create a file calleddisable-pyls-livepyin the project’s root folder.What is the (default) expected behavior?In addition to making debugging and testing easier, this plugin also aims to promote the use ofmodern methods and toolsfor working with Python projects. It can be configured for other tools, but no configuration is required whennox,poetryandpytestare used. By default, the plugin:Creates anoxfile.pyin the project, or a pyls-livepy session is added if one exists (once a project file is accessed).Usespoetryto install the project into an existing nox environment.Runs tests on every syntatically correct change.Indicates failing/exception-throwing tests via LSP diagnostic markers.Where can I find more information?Further documentation is a work in progress.NotesDue to the fact that this plugin must be installed into the project, and it was created for Python v3.7, the project must also use minimum 3.7.*Debug data view functionality has not yet been implemented (as of v0.1.0).**Individual pytest cases can also be ran by importingrun_pytest_casefrompyls_livepyand passing a CLI string that selects a test, within the doctest. The test file name MUST be the name of the tested module prepended by “test_”, and the module MUST be imported at the global level.This project has been set up using PyScaffold 3.2.3. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: pyls-memestra
pyls-memestraMemestraplugin for thePython Language ServerInstallationFrom pippip install pyls-memestraFrom Mambamamba install -c conda-forge pyls-memestraFrom Condaconda install -c conda-forge pyls-memestraFrom sourcegitclonegit@github.com:QuantStack/pyls-memestra.gitcdpyls-memestra
python-mpipinstall-e.For a development environmentinstall dependenciesmamba install -c conda-forge python jupyterlab nodejs python-lsp-server frilouz memestra jupyter-lspinstall thejupyter-lspfrontend extension (only for JupyterLab<3 users):jupyterlabextensioninstall@krassowski/jupyterlab-lsp# for JupyterLab 2.x# jupyter labextension install @krassowski/jupyterlab-lsp@0.8.0   # for JupyterLab 1.xinstall thepyls-memestrapluginpython-mpipinstall-e.
Package: pyls-mypy
This is a plugin for the Palantir’s Python Language Server (https://github.com/palantir/python-language-server)It, like mypy, requires Python 3.2 or newer.InstallationInstall into the same virtualenv as pyls itself.pip installpyls-mypyConfigurationlive_mode(default is True) provides type checking as you type.As mypy is unaware of what file path is being checked, there are limitations with live_modeImports cannot be followed correctlyStub files are not validated correctlyTurning off live_mode means you must save your changes for mypy diagnostics to update correctly.Depending on your editor, the configuration should be roughly like this:"pyls":
{
    "plugins":
    {
        "pyls_mypy":
        {
            "enabled": true,
            "live_mode": false
        }
    }
}
Package: pylso-foam
title: pylso-foam
subtitle: Python module for Large Scale Orchestration of OpenFoam computations.
author: Johan Hidding, Pablo Rodríguez SanchezThis module lets you interact with OpenFOAM through Python. You may use it in cases where you need to run a lot of separate computations in OpenFOAM, possibly in parallel. In our view, this fixes a few gaps in the PyFoam module. Here's whatpylso-foamcan andPyFoamcan't do:Run jobs in parallel: PyFoam has a lot of hidden state. Inpylso-foamevery job runs in its own case directory.Work with binary OpenFOAM files: by using thebyteparsingpackage, we can interact with binary data. We don't involve any geometry here, we can just read the raw data and do some arithmetic on it.AdminYou maypip installthis module. If you're developing however, we usepoetryto manage dependencies.LicenseApache 2
Package: pylspclient
pylspclientA Python 3.10+ implemntation of aLSPclient.What is LSP?Getting startedInstallationpip install pylspclientContributingIn order to contribute you need to make sure your PR passes all theTest Packagesteps. You can run it locally as well:Run the testspip install -e .
pip install -r requirements.test.txt
pytest testRun the linterruff check .LicenseThis project is made available under the MIT License.
Package: pylsp-myplugin
pylsp-mypluginPackage description for PyPIThis is a plugin forPython LSP Server.InstallationTo use this plugin, you need to install this plugin in the same virtualenv as python-lsp-server itself.pipinstallpylsp-mypluginThen runpython-lsp-serveras usual, the plugin will be auto-discovered bypython-lsp-serverif you've installed it to the right environment. Refer topython-lsp-serverand your IDE/text editor documentation on how to setuppython-lsp-server.Configuration... TODO ...FeaturesThis plugin adds the following features topylsp:... TODO ...DevelopingInstall development dependencies with (you might want to create a virtualenv first):gitclonehttps://github.com/python-lsp/pylsp-mypluginpylsp-myplugincdpylsp-myplugin
pipinstall-e'.[dev]'Enabling loggingTo enable logging in pylsp:pylsp -v --log-file /tmp/pylsp.logEnabling tcp modeNormally, editors communicate with language servers through standard
input/output. Optionally, you can run pylsp in tcp mode if you want to be able
to use the standard input/output, for example so you can use IPython or pudb,
using the --tcp flag:pylsp -v --log-file /tmp/pylsp.log --tcp --port 7090Consult your lsp client documentation on how to connect to tcp-mode language
server, but if it doesn't support connecting to a language server via TCP, then
usually can configurenetcat/ncto be your "language server" that will
proxy requests to a tcp-mode language server:nc localhost 7090TODO: document how to connect to pylsp via pylsp from LSP clients.TestingRunpytestto run plugin tests.PublishingIf this is your first time publishing to PyPI, follow the instruction atTwine
docsto create an PyPI account and setup Twine.Update version number insetup.cfg.Build a package using setuptools:python-mbuild
twinecheckdist/*Tag the release:git tag --sign 0.1.3
git push origin 0.1.3Then upload using Twine:twine upload --sign dist/*Alternatively, you may want to upload to Test PyPI first before going live:twine upload --repository testpypi dist/*CreditsThis package was created withCookiecutterfrompython-lsp/cookiecutter-pylsp-pluginproject template.
Package: pyls-pop
python-lsp-server plugin for pop namespace compatibilityAboutpython-lsp-serveris a python implementation of Microsoft’s Language Server Protocol.
This plugin is designed to give functionality to the LSP server for python pop projects.What is POP?This project is built forpop, a Python-based
implementation ofPlugin Oriented Programming (POP). POP seeks to bring
together concepts and wisdom from the history of computing in new ways to solve
modern computing problems.For more information:Intro to Plugin Oriented Programming (POP)pop-awesomepop-createGetting StartedPrerequisitesPython 3.6+git(if installing from source, or contributing to the project)InstallationNoteIf wanting to contribute to the project, and setup your local development
environment, see theCONTRIBUTING.rstdocument in the source repository
for this project.If wanting to usepyls-pop, you can do so by either
installing from PyPI or from source.Install from PyPIpipinstallpyls-popInstall from source# clone repogitclonegit@gitlab.com:saltstack/pop/pyls-pop.gitcdpyls-pop# Setup venvpython3-mvenv.venvsource.venv/bin/activatepipinstall-e.UsageFor your convenience, here is where you can find more information on running python-lsp-server in popular IDEsCLIAfter installingpyls-pop, the pylsp command will be available (from the python-lsp-server project).
Run with “–help” to see other options available while running this command.pylspvimFollow the instructions for installing thevim-lspplugin.
Then register the “pylsp” command as a language server.vim-lsp-settingscan be used to automate some parts of the process.PyCharmInstall theLanguage Server Protocol pluginfrom the IntelliJ marketplace.
Navigate to Pycharm Settings > Language Server Protocol > Server Definitions.
Add a new server definition of type “Executable” (The first drop-down menu in the server definition).
For the “Extension” use “py”.
Add the full path to the “pylsp” command you want to use.
Ideally, a version of the command that is in the same python environment as the your source project’s source code.VSCodeYou might have to run pylsp with the “–tcp” and port flags.Thisis all we have at the moment on implementing in VSCodeRoadmapReference theopen issuesfor a list of
proposed features (and known issues).AcknowledgementsImg Shieldsfor making repository badges easy.
Package: pyls-spyder
pyls-spyderCopyright © 2020– Spyder Project ContributorsOverviewSpyder extensions for thepython-lsp-server(pylsp). This package provides Spyder-specific extras for theLanguage Server Protocol(LSP) on Python, such as document symbol searching and others.InstallingTo install pyls-spyder, you can use both conda or pip package managers:# Using conda (Recommended)condainstallpyls-spyder-cspyder-ide# Using pippipinstallpyls-spyderDependenciesThis package depends on thepython-lsp-serverto integrate the Spyder-specific extensions.Installing locallyTo install and develop spyder-pyls locally, you will need to install the python-lsp-server:# Using condacondainstallpython-lsp-server# Using pippipinstallpython-lsp-serverThen, you can install the package locally using pip:pipinstall-U-e.Running testsWe use pytest to run tests as it follows:pytest-x-vpyls_spyder/testsExtended LSP callsLSP methodSpyder extensionstextDocument/documentSymbolFind code cells# %%and block comments# --textDocument/foldingRangeReturn code cells# %%as code folding regionsPlugin configuration optionsThis plugin can be configured by using the keypyls_spyderwhen callingworkspace/didChangeConfigurationon the pyls. Each configuration option is described below:LSP methodConfiguration KeyTypeDescriptiontextDocument/documentSymbolgroup_cellsboolEnable/Disable code cell grouping according to the total number of leading percentagesenable_block_commentsboolEnable/disable block comment detectionChangelogPlease see ourCHANGELOGfile to learn more about our new features and improvements.Contribution guidelinesWe follow PEP8 and PEP257 for all Python modules. We use MyPy type annotations for all functions and classes declared on this package. Feel free to send a PR or create an issue if you have any problem/question.
Package: pylst
pylstShields for version badgespylst is a Python package designed for processing and visualizing Landsat Land Surface Temperature (LST) data.Free software: MIT licenseDocumentation:pylst DocumentationFeaturesComprehensive processing tools for Landsat LST data.Flexible visualization methods for analyzing temperature data.Easy-to-use functions to compute and manipulate temperature-related indices.Getting StartedInstallationTo install pylst, you can usepip:pipinstallpylst