Saravanan666/pypi-org huggingface dataset:
Package: riversand
Catchmentwide erosion rates with riversandriversandis a python package to calculate catchmentwide erosion rates from
cosmogenic nuclide concentrations in river sand samples. The program computes
the hypsometric statistics of the catchment area from a digital elevation model.
It uses the online erosion rate calculator by Greg Balco
(e.g.http://stoneage.hzdr.de/) to determine predicted
nuclide concentrations $N$ for given erosion rates $E$, and calculates
the erosion rate that corresponds to the measured nuclide concentration from a
polynomial fit $N(E)$.The method works for in situ Be-10 and Al-26 data. It is fast (few seconds for
one catchment) for all production scaling methods implemented in the online
calculator (St: Lal 1991/Stone 2000;Lm: Lal/Stone with a geomagnetic correction
after Nishiizumi et al. 1989;LSDn: Lifton et al. 2014) and independent of the
catchment size or the resolution of the digital elevation model. It is considered
robust for catchments up to approx. 600 km x 600 km; for larger catchments
the effect of latitude on cosmogenic production may become significant.The approach is described in:Stübner, K., Balco, G., and Schmeisser, N. (2023). Riversand: a new tool for efficient computation of catchmentwide erosion rates.Radiocarbon.(link).Definitely check out the documentation of the online calculator (e.g.hereorhere) and the publicationBalco et al. (2008)before using this calculator.Documentationquickstart.ipynbstep_by_step.ipynbtest_data/: geotiffs of a 35m-resolution digital elevation model, a topographic shielding raster generated withTopoToolboxand a binary raster indicating quartz-bearing and quartz-free lithologies; shapefiles with catchment outlines; a spreadsheet with sample data.InstallationInstall riversand by running:$ pip install riversand
$ pip install --upgrade riversandRequirementsnumpy, scipy, pandas, xarrayrasterio, fiona, pyprojmatplotlibLicenseGNU General Public License v3.0
Package: rivers-datasets-aggregation
rivers-datasets-aggregationA toolbox for grid and vector data aggregation on river stations.OverviewModule features :Extractraster values corresponding to a dataset of points (river stations)Relocatea dataset of points (river stations) on a river networkGetting startedOption 1 - Virtual environmentCreate a virtual environment with venv:python3 -m venv rda_venv
source rda_venv/bin/activate

pip install -e .
pip install -e .[dev]

pre-commit installOption 2 - Conda environmentCreate a virtual environment with conda:conda env create -f environment.yml
conda activate aggregation

pre-commit install
Package: rivertext
RiverTextRiverTex is an open-source library for modeling and training different incremental word vector architectures proposed by the state-of-the-art.It seeks to standardize many existing incremental word vector algorithms into a unified framework to provide a standardized
interface and facilitate the development of new methods.RiverTex provides two training paradigms:learn_one, which trains one instance at a time;andlearn_many, which trains a mini-batch of instances at a time.This allows for more efficient training of text representation models with text data streams.RiverText also provides an interface similar to theriverpackage, making it easy for developers to use the library to quickly
and easily train text representation models.The official documentation can be found at thislink.InstallationRequirementsThese package will be installed along with the package, in case these have not already been installed:nltknumpyriverscikit_learnscipytorchtqdmContributingDevelopment RequirementsTestingAll unit tests are in the rivertext/tests folder. It usespytestas a framework to run them.To run the test, execute:pytest testsTo check the coverage, run:pytest tests --cov-report xml:cov.xml --cov rivertextAnd then:coverage report -mBuild the documentationThe documentation is created usingmkdocsandmkdocs-material. It can be found in the docs folder at the root of the project. First, you need to install:pip install mkdocs
pip install "mkdocstrings[python]"
pip install mkdocs-materialThen, to compile the documentation, run:mkdocs build
mkdocs serveChangelogReferences@article{montiel2021river,title={River: machine learning for streaming data in Python},author={Montiel, Jacob and Halford, Max and Mastelini, Saulo Martiello and Bolmier, Geoffrey and Sourty,Raphael and Vaysse, Robin and Zouitine, Adil and Gomes, Heitor Murilo and Read, Jesse and Abdessalem,Talel and others},year={2021}}@article{bravo2022incremental,title={Incremental Word Vectors for Time-Evolving Sentiment Lexicon Induction},author={Bravo-Marquez, Felipe and Khanchandani, Arun and Pfahringer, Bernhard},journal={Cognitive Computation},volume={14},number={1},pages={425--441},year={2022},publisher={Springer}}@article{kaji2017incremental,title={Incremental skip-gram model with negative sampling},author={Kaji, Nobuhiro and Kobayashi, Hayato},journal={arXiv preprint arXiv:1704.03956},year={2017}}TeamGabriel IturraFelipe Bravo-MarquezContactPlease write to gabrieliturrab at ug.chile.cl for inquiries about the software. You are also welcome to do a pull request or publish an issue in the RiverText repository on Github.
Package: river-torch
river-torch is a Python library for online deep learning.
    River-torch's ambition is to enableonline machine learningfor neural networks.
    It combines theriverAPI with the capabilities of designing neural networks based onPyTorch.💈 Installationpipinstallriver-torchorpipinstall"river[torch]"You can install the latest development version from GitHub as so:pipinstallhttps://github.com/online-ml/river-torch/archive/refs/heads/master.zip🍫 QuickstartWe build the development of neural networks on top of theriver APIand refer to the rivers design principles.
The following example creates a simple MLP architecture based on PyTorch and incrementally predicts and trains on the website phishing dataset.
For further examples check out theDocumentation.Classification>>>fromriverimportmetrics,datasets,preprocessing,compose>>>fromriver_torchimportclassification>>>fromtorchimportnn>>>fromtorchimportoptim>>>fromtorchimportmanual_seed>>>_=manual_seed(42)>>>classMyModule(nn.Module):...def__init__(self,n_features):...super(MyModule,self).__init__()...self.dense0=nn.Linear(n_features,5)...self.nonlin=nn.ReLU()...self.dense1=nn.Linear(5,2)...self.softmax=nn.Softmax(dim=-1)......defforward(self,X,**kwargs):...X=self.nonlin(self.dense0(X))...X=self.nonlin(self.dense1(X))...X=self.softmax(X)...returnX>>>model_pipeline=compose.Pipeline(...preprocessing.StandardScaler(),...classification.Classifier(module=MyModule,loss_fn='binary_cross_entropy',optimizer_fn='adam')...)>>>dataset=datasets.Phishing()>>>metric=metrics.Accuracy()>>>forx,yindataset:...y_pred=model_pipeline.predict_one(x)# make a prediction...metric=metric.update(y,y_pred)# update the metric...model_pipeline=model_pipeline.learn_one(x,y)# make the model learn>>>print(f"Accuracy:{metric.get():.4f}")Accuracy:0.6728Anomaly Detection>>>fromriver_torch.anomalyimportAutoencoder>>>fromriverimportmetrics>>>fromriver.datasetsimportCreditCard>>>fromtorchimportnn>>>importmath>>>fromriver.composeimportPipeline>>>fromriver.preprocessingimportMinMaxScaler>>>dataset=CreditCard().take(5000)>>>metric=metrics.ROCAUC(n_thresholds=50)>>>classMyAutoEncoder(nn.Module):...def__init__(self,n_features,latent_dim=3):...super(MyAutoEncoder,self).__init__()...self.linear1=nn.Linear(n_features,latent_dim)...self.nonlin=nn.LeakyReLU()...self.linear2=nn.Linear(latent_dim,n_features)...self.sigmoid=nn.Sigmoid()......defforward(self,X,**kwargs):...X=self.linear1(X)...X=self.nonlin(X)...X=self.linear2(X)...returnself.sigmoid(X)>>>ae=Autoencoder(module=MyAutoEncoder,lr=0.005)>>>scaler=MinMaxScaler()>>>model=Pipeline(scaler,ae)>>>forx,yindataset:...score=model.score_one(x)...model=model.learn_one(x=x)...metric=metric.update(y,score)...>>>print(f"ROCAUC:{metric.get():.4f}")ROCAUC:0.7447🏫 Affiliations
Package: rivertrace
River TraceIdentifies rivers in satellite images and generates a profile of pixel values along its length.InstallationInstall from PYPIpip install rivertraceInstall from GitHubClone the repository to your local machine using the command:git clone git@github.com:JamesRunnalls/river-trace.gitNote that the repository will be copied to your current working directory.Use Python 3 and install the requirements with:pip install -r requirements.txtThe python version can be checked by running the commandpython --version. In case python is not installed or only an older version of it, it is recommend to install python through the anaconda distribution which can be downloadedhere.UsageRiver trace can be used to find the shortest path through any 2D binary array where 1 represents water and 0 represents not water.Basic Example (source)importnumpyasnpfromrivertraceimporttracefromrivertrace.functionsimportplot_matrixsquare=np.zeros((20,20),dtype=np.uint8)square[0:2,0:5]=1square[0:8,5:8]=1square[6:9,8:12]=1square[8:15,10:14]=1square[15:20,12:15]=1square[18:20,15:20]=1path=trace(square,[0,0],[19,19])forpinpath:square[p[0],p[1]]=2plot_matrix(square,"Final path plotted on original data")Satellite ImageryRiver trace was primarily developed to trace river paths from satellite imagery. You can see an examplehereof how to extract data from a satellite image.Below are the preparation steps for producing a turbidity long section using Sentinel 2 imagery.Download the Sentinel 2 image for your desired location and date.Use a processing algorithm to calculate your desired output parameter (e.g. Polymer, C2RCC, ACOLITE)Create a water classification band (e.g. NDWI, SWI)Import the band into python and convert to a binary arrayUse rivertrace to track the shortest path through the river networkHow it worksRiver trace relies heavily onscikit-imagefor the initial morphological thinning of the binary matrix. This outputs a 1px wide "centerline" of available river sections.This centerline is abstracted to nodes and edges andnetworkxis used to calculate the dijkstra (shortest) path through the network. This is the re-assembled as complete path.
For some rivers there may be gaps in the water surface due to clouds/ bridges/ vegetation, so where a complete path is not avaialble the algorithm progressively allows greater and greater "jumps" between connected river sections.ProjectsSee the followingrepositoryfor examples of where river trace has been used to track river pollution events from tailings dam failures.
Package: riverwm-utils
riverwm-utilsUtilities for the River Wayland compositor. Currently just one utility is included.Usagecycle-focused-tagsChange to either the next or previous focused tags.As can be seen in apull
request, this
functionality can easily be built directly into river. However,as
explained by Leon
Plickatthere is a plan to separate the window management to a separate
client, and as such new additions are not being accepted. The
approach implemented here was suggested and sample code was
provided. That sample code forms the basis of this script.The script takes two arguments: the first is being the direction
next|previous, the second being the maximum number of tags at which
the cycling should wrap back to the first tag (or to the last tag from
the first tag).If the second argument is omitted the maximum number of tags is
assumed to be 32.  If both arguments are ommited the direction,
next, will be used.The script can be called using spawn in the users init file. For example:riverctl map normal Mod4 Up spawn "cycle-focused-tags previous 9"
riverctl map normal Mod4 Down spawn "cycle-focused-tags next 9"InstallDevelopment versionClone the repository:git clone https://github.com/NickHastings/riverwm-utils.gitInstall locally with pippython3 -m pip install ./riverwm-utilsStable realeasespython3 -m pip install riverwm-utilsWayland protocols and pywaylandForcycle-focused-tagsto work the relevant wayland protocol xml
files will need to be scanned by pywayland. If this has not already
been donecycle-focused-tagswill attempt to do so.Licensingriverwm-utils is released under the GNU General Public License v3.0 only.The protocols in theprotocoldirectory are released under various licenses by
various parties. You should refer to the copyright block of each protocol for
the licensing information.
Package: rivery-cli
OverviewRivery CLI is an amazing way to manage, deploy, run and edit rivers inside Rivery.
The rivers are configured only by.yamlfiles, as a configuration files, makes this CLI as a basic
of Infrastructure As Code (IaC) methodology.In order to start using the tool, go to theGetting Startedpage.Getting startedRequirementsYou must have Python 3.6 or later installed.
For installation instructions, see theDownloading Pythonpage in Python's Beginner Guide.An API Token with the following scopes:* me:list
    * river:execute
    * river:edit
    * river:list
    * river:delete
    * connection:edit
    * connection:list
    * connection:deleteIn order to create a new API token,please refer to our docsInstallInstall Rivery CLI, by using the next command:pipinstall-Urivery-cliInitiate a new projectin order to start newproject:create new project directory, for example in linux base OS:>mkdir/home/my-projector in windows:>mkdirc:\my-projectGo into themy-projectdirectory you've created:cd my-projectrun the next command and choose your project name.>riveryinitCreate the first profileRivery CLI store defaults and credentials under an "entity" calledprofile.Each profile has its name and the configurations under it. Due to every API token refers
to specific account+environment inside your Rivery console, and every account+environment pair has
its own credentials, it is likely you'll have a profile per each account+environment coupling.For creating your first profile use the next command:>riveryconfigureAnd Follow the prompt:>Pleaseenteryourtoken.(******):...
>ChooseyourRegion()[...]:...
>Thankyouforenteringauthcredentials.>Pleasecheckyourprofileat:~/.rivery/authAnd you're good to go!Issues and Feature RequestsRivery CLI and IaC engine is fully open source dir.
We're getting in warm welcome any issues/features submitted to our end, and encourage the community to contribute in the solution.
Please don't hesitate to add any issues/feature request using therepo's Issues section.Getting start With RiveryYou can check out our product docs athttps://docs.rivery.ioin order to getting started.Full documentationYou may find here thefull documentation.
Package: rivescript-coverage-plugin
A plug-in to measure code coverage in RiveScript with pythonFeaturesThe RiveScript Coverage Plugin is a plugin for Coverage.py which extends that package to measure code coverage for RiveScript files.  It uses code analysis tools and debug hooks provided by the RiveScript interpreter to determine which lines are executable, and which have been executed.  It supports CPython version 3.6 and above and plugs into Coverage.py version 5.0 and above.  It requires RiveScript 1.14.9 or above.Documentation is onRead The Docs. Code repository and issue tracker are onGitHub.Getting StartedUse pip to install:$ pip install rivescript_coverage_pluginCreate or edit your.coveragercfile and add this:[run]
plugins = rivescript_coverage_pluginRun thecoveragecommand orpytestwith the--covoption and your RiveScript files will automatically be included in the coverage analysis and subsequent report generation.Note that just like with Python coverage, RiveScript files that are not executed at all will not be part of your coverage report.  To add them, use thesource = .or other more specific source specifier in the[run]section of your.coveragercfile or the--sourcecommand line option.  See theCoverage Documentationsection “Specifying source files” for more information on this.DocumentationThe full documentation is athttp://rivescript_coverage_plugin.rtfd.org.History0.1.0 (2020-01-16)First release on PyPI.0.2.0 (2020-01-17)Fix Issues #1-#40.2.1 (2020-01-19)Fix Issue #50.2.2 (2020-01-19)Fix Issue #60.2.3 (2020-02-23)Fix Issue #7, #81.0.0 (2020-02-28)Add syntax highlighting, fixup some documentation issues, and fix issues #9-#14.1.1.0 (2020-03-29)Fix issues #15-#18 and #21.
Package: rivindel
RivIndelIN CONSTRUCTION!MotivationComplex indels (cxIndels) often introduce multiple deletions, insertions and mismatches during the alignment phase.
Complex indels are prone to be found on highly unstable genomes such as Lung Adenocarcinoma (LUAD).
A correct interpretation in terms of net base change is crucial: e.g. exon 19 EGFR inframe deletions are actionable, but not frameshift deletions.These variants are typically called as multiple individual variants by some popular somatic callers (Mutect2, Lancet, etc).
Since these individual variants are closely located, there is a high chance that they come from a single compound variant.RivIndel detects complex indels from targeted sequencing (Illumina).
RivIndel scans every targeted region (supplied as a BED file) in a similar fashion than indelSeek.
However, RivIndel validates candidate cxIdels after a successful assembly of candidate reads (plus neighbouring soft-clipped reads).
This, in turn, leads to a better allele frequency estimation.Method overviewInstall RivIndel locallyClone RivIndel repository:git clone https://github.com/bdolmo/RivIndel.git
cd RivIndel/Install via pippip3 install -e .Usagepython3 RivIndel.py --bam <input.bam> --bed <test.bed> --vcf <out.vcf>
Package: rivulet
Documentation:Read the docs.Quickstart$ pip install rivuletNotesLimitationsNo balanced consumers (yet)Without the proper management tools (see todos), managing messages is
painful raw redis.TodosExtend testingConnection dropsParallel producers, consumers (stressing the locking setup)Provies management functionalitylist channels, delete channelscount, list, update subscriberscount, list, prune messagesImplementation detailsData model:rvl:lock:<channel_id>: Used to maintain locks across
multi-step redis calls (in particular when sending a message using
a server-issued, monotonically increasing message seq id).rvl:id:<channel_id>: A counter providing sequence ids for
messages in channelchannel_idrvl:msg:<channel_id>: ZSET that maps a packed JSON string
to the message sed id (allowing range queries on messages over seq
ids).rvl:channel:<channel_id>: ZSET that maps a client id to the last
message id in channelchannel_idseen by the clinetrvl:index:<client_id>: ZSET that maps the channel_id to the last
message id seen by clientclient_id
Package: riweather
riweatherGrab publicly available weather data withriweather.See the full documentation.InstallationInstall with pip:pip install riweatherTo create interactive maps of weather station locations, install the package along with its optional dependencies:pip install riweather[plots]UsageGiven a latitude and longitude, get a list of weather stations sorted from nearest to farthest from that location.>>>importriweather>>>station_rank=riweather.rank_stations(39.98,-105.13,max_distance_m=20000)Select the top station (or a different station):>>>station=riweather.select_station(station_rank,rank=0)View information about that station:>>>station.name,station.usaf_idAnd pull weather data from that station for a certain year.>>>station.fetch_temp_data(2022)
Package: riyapycounts
riyapycountsCalculate word counts in a text file!Installation$pipinstallriyapycountsUsageriyapycountscan be used to count words in a text file and plot results
as follows:fromriyapycounts.riyapycountsimportcount_wordsfromriyapycounts.plottingimportplot_wordsimportmatplotlib.pyplotaspltfile_path="test.txt"# path to your filecounts=count_words(file_path)fig=plot_words(counts,n=10)plt.show()ContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licenseriyapycountswas created by Riya Eliza. It is licensed under the terms of the MIT license.Creditsriyapycountswas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: rizapubsub
RizaPubsubinhouse gcp pubsubpublishimporttimefrompubsubimportPubSubc={}# beginp=PubSub(c)publisher=p.pub()# xpub = p.create_topic('test_001')# print(xpub)# xsub = p.create_subscription('test_001', 'test_sub_001')# print(xsub)3pid=p.send(publisher,{'topic':'test001','namespace':'auth','subname':'auth_register','delay':1,'data':{'fullname':'mas joko','email':'panas@gmail.com'}})print('send pubsub:',pid)subscribeimportasynciofromdatetimeimportdatetimefrompubsubimportPubSubc={}asyncdefexecutor(data):print("{}".format(data.data),datetime.now())asyncdefsublistener(config,subname,count=1):'''Pubsub listen subscribtion tasks'''p=PubSub(c)whileTrue:subscrb=p.sub()withsubscrb:subpath=subscrb.subscription_path(config["project_id"],subname)# get messagesresponse=subscrb.pull(request={'subscription':subpath,'max_messages':count})ack_ids=[]formsginresponse.received_messages:# print("Received: {}".format(msg.message))awaitexecutor(msg.message)ack_ids.append(msg.ack_id)# Acknowledges the received messages so they will not be sent again.tot=len(response.received_messages)iftot>0:subscrb.acknowledge(request={"subscription":subpath,"ack_ids":ack_ids,})awaitasyncio.sleep(2)# beginasyncdefmain_pubsub(c):awaitsublistener(c,'test001-sub',10)if__name__=='__main__':loop=asyncio.new_event_loop()try:loop.create_task(main_pubsub(c))loop.run_forever()exceptKeyboardInterrupt:loop.close()finally:loop.close()
Package: rizhiy-cfg
Python Configuration SystemDescriptionLibrary to define configurations using python files.InstallationRecommended installation with pip:pipinstallrizhiy-cfgUsageDefine config schema:# project/config.pyfromrizhiy_cfgimportCL,CNclassBaseClass:passcfg=CN()# Basic config nodecfg.DICT=CN()# Nested config nodecfg.DICT.FOO="FOO"# Config leaf with actual valuecfg.DICT.INT=1cfg.NAME=CL(None,str,required=True)# Specification of config leaf to be defined with typecfg.CLASSES=CN(BaseClass)# Config node with type specification of its config leafscfg.SUBCLASSES=CN(CL(None,BaseClass,subclass=True))# Config node with subclass specification of its config leafscfg.VAL=CL(1,desc="Interesting description")# Config leaf with descriptiondeftransform(cfg:CN)->None:cfg.DICT.FOO="BAR"defvalidate(cfg:CN)->None:assertlen(cfg.NAME)>0defhook(cfg:CN)->None:print("Loaded")# Add transform, validation & hooks function# Transforms are run after config is loaded and can change values in configcfg.add_transform(transform)# Validators are run after transforms and freeze, with them you can verify additional restrictionscfg.add_validator(validate)# Hooks are run after validators and can perform additional actions outside of configcfg.add_hook(hook)# Validators and hooks should not (and mostly cannot) modify the configSet actual values for each leaf in the config,the import has to be absolute:# my_cfg.pyfromrizhiy_cfgimportCNfromproject.configimportcfg# Import has to be absolute# Pass schema as an argument to the CN() to init the schemacfg=CN(cfg)# Schema changes are not allowed here, only leafs can be altered.cfg.NAME="Hello World!"cfg.DICT.INT=2You can also create another file to inherit from first and add more changes:# my_cfg2.pyfromntcimportCNfrom.my_cfgimportcfg# This import has to be relative and should only import cfg variablecfg=CN(cfg)cfg.DICT.FOO="BAR"There a few restrictions on imports in configs:When you are importing config schema from project that import has to beabsoluteWhen you inherit config values from another file, that import has to berelativeOther than config inheritance, all other imports have to beabsoluteLoad actual config and use it in the code.# main.pyfromrizhiy_cfgimportCNcfg=CN.load("my_cfg.py")# Access values as attributesassertcfg.NAME=="Hello World!"assertcfg.DICT.FOO=="BAR"DevelopmentFormattingThis repository follows strict formatting style which will be checked by the CI.To properly format the code, use theblackformat:pipinstall-e".[dev]"black.LintingFor linting and basic fixesruffis used:pipinstall-e".[dev]"ruffcheck.--fixTestingTo test code, usepytest:pipinstall-e".[test]"pytest.CommittingThis repository follows semantic-release, which means all commit messages have to follow astyle.