Package: tada-predict
Tada!: auTomAtic orDer-of-growth AnalysisTada is a tool that systematically runs a doubling experiment to ascertain the
likely worst-case order-of-growth function for an arbitrary Python function.
This documentation provides a brief overview about how to run the tool, its
provided test suite, and more.Documentation:https://tada-predict.netlify.appInstall TadaOperating system: Linux · macOS/OS X · WindowsPython version: Python 3.6+Dependency Management:Pipenv·PoetryInstall Tada with pipInstall Tada withpip:pipinstalltada-predictInstall through Github RepoAlternatively, you can also install Tada manually by cloning the repository and
installing the dependencies through eitherPipenvorPoetry. This is also the common
way if you want to make changes to the code base.First, you can clone this repository with the following command:gitclonegit@github.com:Tada-Project/tada.gitPoetryIf you would like to install dependencies throughpoetry, you would first need
to installpoetryon your local machine like this:pipinstallpoetryOnce you have installedpoetry, you can then install the dependencies for
Tada with the following command.poetryinstallYou can also activate thepoetryshell by running this command:poetryshellPipenvSimilarly, you can run the following command to installpipenvon your local
machine:pipinstallpipenvTo install dependencies withpipenv, you can just run:pipenvinstall--no-devYou can activate thepipenvshell with this command:pipenvshellRun CommandTo run Tada, you can just type the following command with the arguments into the
terminal window within your preferred virtual environment:tada[-h]--directoryDIRECTORY--moduleMODULE--functionFUNCTION--typesTYPES[TYPES...]You can learn about Tada's checks and defaults by typingtada -hin your
terminal window and then reviewing the following output.usage:tada[-h]--directoryDIRECTORY[DIRECTORY...]--module[MODULE[MODULE...]--functionFUNCTION[FUNCTION...]--typesTYPES[TYPES...][--data_directoryDATA_DIRECTORY][--data_moduleDATA_MODULE][--data_functionDATA_FUNCTION][--schemaSCHEMA][--startsizeSTARTSIZE][--stepsSTEPS][--runningtimeRUNNINGTIME][--expectEXPECT][--backfill][--indicatorINDICATOR][--maxsizeMAXSIZE][--sorted][--log][--md][--contrast][--levelLEVEL][--position]POSITION[POSITION...]]optionalarguments:-h,--helpshowthishelpmessageandexit--directoryDIRECTORY[DIRECTORY...]Pathtothepackagedirectorywithfunctionstoanalyze(default:None)--moduleMODULE[MODULE...]Modulenamewithfunctionstoanalyze(default:None)--functionFUNCTION[FUNCTION...]Nameofthefunctiontoanalyze(default:None)--typesTYPES[TYPES...]Datagenerationtype:hypothesisorparametertypesofthefunction(default:None)--data_directoryDATA_DIRECTORYPathtothepackagedirectorywithfunctiontogeneratedata(default:None)--data_moduleDATA_MODULEModulenamewithfunctionstogeneratedata(default:None)--data_functionDATA_FUNCTIONNameofthedatagenerationfunction(default:None)--schemaSCHEMAThepathtotheJSONschemathatdescribesthedataformat(default:None)--startsizeSTARTSIZEStartingsizeofthedoublingexperiment(default:1)--stepsSTEPSMaximumroundsofthedoublingexperiment(default:10)--runningtimeRUNNINGTIMEMaximumrunningtimeofthedoublingexperiment(default:200)--expectEXPECTExpectedGrowthRatio:O(1)|O(logn)|O(n)|O(nlogn)|O(n^2)|O(n^3)|O(c^n).Byusingthisargument,theexperimentresultwillbestoredinacsvfile(default:None)--backfillEnablebackfilltoshrinkexperimentssizeaccordingtothePredictedTrueValue(default:False)--indicatorINDICATORIndicatorvalue(default:0.1)--maxsizeMAXSIZEMaximumsizeofthedoublingexperiment(default:1500)--sortedEnableinputdatatobesorted(default:False)--logShowlog/debug/diagnosticoutput(default:False)--mdShowresultstableinmarkdownformat(default:False)--contrastShowcontrastresulttable.Onlyworkswithmultipleexperiments(default:False)--vizVisualizeasimplegraphfortheresult(default:False)--levelLEVELThelevelofnesteddatastructuretoapplydoublingexperiment(default:1)--positionPOSITION[POSITION...]Thepositionofinputdatatodoubleinthemultivariabledoublingexperiment.Mustbethelastargument(default:[0])Sampleusage:tada--directory/path/to/project_directory--modulemodule_name.file_name--functionfunction_name--typeshypothesisRunning within Tada RepoIf you are running within the Tada repository, then you could also easily run
Tada within the shell activated by the dependency management tool you previously
installed like this:pythontada/tada_a_bigoh.py[-h]--directoryDIRECTORY--moduleMODULE\--functionFUNCTION--typesTYPES[TYPES...]It is worth noting that when the provided experiment function is relied on an
external Python library, it is likely that Tada might not have this dependency,
and thus, it might cause an error when running the experiment. You can simply
resolve this issue by installing the required dependencies through your chosen
dependency management tool like this:Withpipenv:pipenv install <library-name>Withpoetry:poetry add <library-name>Quick Start ExampleWe have provided some code examples inSpeed-Surprisesfor you to run Tada in conjunction and experience how Tada automatically suggests
the likely worst-case order-of-growth function for various types of Python function.
You can follow the instructions inSpeed-Surprisesto clone the repository and install the dependencies.After successfully setting up the repository on your local machine, you can
then run the following command to conduct an experiment forinsertion_sortwithin thespeed-surprisesrepository:tada--directory.--modulespeedsurprises.lists.sorting\--functioninsertion_sort--typeshypothesis\--schemaspeedsurprises/jsonschema/single_int_list.jsonWithin a minute or so, you will be able to inspect an output similar to the
following with a results table provided at the end of the experiment.Tada!:auTomAticorDer-of-growthAnalysis!https://github.com/Tada-Project/tada/ForHelpInformationType:pythontada-h

Startrunningexperimentinsertion_sortforsize1→


→Donerunningexperimentinsertion_sortforsize1.
.
.
→Donerunningexperimentinsertion_sortforsize64+-----------------------------------------------------------------------------+|insertion_sort:O(n)linearorO(nlogn)linearithmic|+------+------------------------+------------------------+--------------------+|Size|Mean|Median|Ratio|+------+------------------------+------------------------+--------------------+|1|4.882118635177613e-07|4.6806960487365676e-07|0||2|7.456634746551513e-07|7.133920059204101e-07|1.527335835885569||4|9.27755012257894e-07|9.209306488037112e-07|1.2442006934655812||8|1.3545460286458332e-06|1.3353490028381343e-06|1.4600255571233727||16|2.2379635269165037e-06|2.2146971740722657e-06|1.6521871384125948||32|3.9610248652140306e-06|3.913619827270508e-06|1.7699237800678478||64|7.2769234293619794e-06|7.211799896240237e-06|1.837131468996415|+------+------------------------+------------------------+--------------------+
O(n)linearorO(nlogn)linearithmicYou can find more information about Tada usage, including experiment data
generation and using different flags and arguments to configure your Tada
experiment through ourdocumentationhere.Add New Features to TadaYou can follow these steps to add a new feature if you are already a
collaborator on the project. First, you should create and publish your new branch
via the following command. Substitute the name of your feature/branch for the wordfeature-name.git checkout -b feature-namegit checkout mastergit push -u origin feature-nameTo install development dependencies, type the following commands in the terminal:poetryinstallYou can activate the shell with the following command:poetryshellFinally, you should open a pull request on the GitHub repository for the new
branch that you have created. This pull request should describe the new feature
that you are adding and give examples of how to run it on the command line.
Of course, if you are not a collaborator on this project, then you will need to
fork the repository, add your new feature, document and test it as appropriate,
and then create a pull request similarly.We highly recommend you to provide tests along with the feature that you
implemented and you should not break the existing test cases or features.Test TadaTo run the test suite for Tada's functions within the shell by typing the
following in your terminal window:pytesttestsIf you want to collect the coverage of the provided test suite, then you can
run:pytest--cov-configpytest.cov--covIf you want to collect the coverage of the provided test suite and see what
lines of code are not covered, then you can run:pytest--cov-configpytest.cov--cov--cov-reportterm-missingProblems or PraiseIf you have any problems with installing or using the Tada or its provided test
suite, then please create an issue associated with this Git repository using theIssueslink at the top of this site. The contributors to Tada will do all that
they can to resolve your issue and ensure that all of its features and the test
suite work well in your development environment.