Package: dendroid
dendroidIn what followspythonis an alias forpython3.7orpypy3.7or any later version (python3.8,pypy3.8and so on).InstallationInstall the latestpip&setuptoolspackages versionspython-mpipinstall--upgradepipsetuptoolsUserDownload and install the latest stable version fromPyPIrepositorypython-mpipinstall--upgradedendroidDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/dendroid.gitcddendroidInstall dependenciespython-mpipinstall-rrequirements.txtInstallpythonsetup.pyinstallUsage>>>fromdendroidimportavl,red_black,splay>>>fromrandomimportsample>>>min_value,max_value=-100,100>>>size=(max_value-min_value)//2>>>values=sample(range(min_value,max_value),size)>>>avl_set,red_black_set,splay_set=(avl.set_(*values),...red_black.set_(*values),...splay.set_(*values))>>>len(avl_set)==len(red_black_set)==len(splay_set)==sizeTrue>>>max_valuenotinavl_setandmax_valuenotinred_black_setandmax_valuenotinsplay_setTrue>>>list(avl_set)==list(red_black_set)==list(splay_set)==sorted(values)True>>>avl_set.add(max_value)>>>red_black_set.add(max_value)>>>splay_set.add(max_value)>>>len(avl_set)==len(red_black_set)==len(splay_set)==size+1True>>>max_valueinavl_setandmax_valueinred_black_setandmax_valueinsplay_setTrue>>>list(avl_set)==list(red_black_set)==list(splay_set)==sorted(values)+[max_value]True>>>prev_max_value=max(values)>>>avl_set.prev(max_value)==red_black_set.prev(max_value)==splay_set.prev(max_value)==prev_max_valueTrue>>>avl_set.next(prev_max_value)==red_black_set.next(prev_max_value)==splay_set.next(prev_max_value)==max_valueTrue>>>avl_set.remove(max_value)>>>red_black_set.remove(max_value)>>>splay_set.remove(max_value)>>>len(avl_set)==len(red_black_set)==len(splay_set)==len(values)True>>>max_valuenotinavl_setandmax_valuenotinred_black_setandmax_valuenotinsplay_setTrue>>>list(avl_set)==list(red_black_set)==list(splay_set)==sorted(values)True>>>avl_set.max()==red_black_set.max()==splay_set.max()==max(values)True>>>avl_set.min()==red_black_set.min()==splay_set.min()==min(values)True>>>avl_set.max()==red_black_set.max()==splay_set.max()==max(values)True>>>avl_set.min()==red_black_set.min()==splay_set.min()==min(values)True>>>avl_set.add(max_value)>>>red_black_set.add(max_value)>>>splay_set.add(max_value)>>>avl_set.popmax()==red_black_set.popmax()==splay_set.popmax()==max_valueTrue>>>avl_set.add(min_value)>>>red_black_set.add(min_value)>>>splay_set.add(min_value)>>>avl_set.popmin()==red_black_set.popmin()==splay_set.popmin()==min_valueTrue>>>min_key,max_key=min_value,max_value>>>keys=sample(range(min_key,max_key),size)>>>items=list(zip(keys,values))>>>avl_map,red_black_map,splay_map=(avl.map_(*items),...red_black.map_(*items),...splay.map_(*items))>>>len(avl_map)==len(red_black_map)==len(splay_map)==sizeTrue>>>max_keynotinavl_mapandmax_keynotinred_black_mapandmax_keynotinsplay_mapTrue>>>list(avl_map)==list(red_black_map)==list(splay_map)==sorted(keys)True>>>avl_map[max_key]=red_black_map[max_key]=splay_map[max_key]=max_value>>>len(avl_map)==len(red_black_map)==len(splay_map)==size+1True>>>max_keyinavl_mapandmax_keyinred_black_mapandmax_keyinsplay_mapTrue>>>avl_map[max_key]==red_black_map[max_key]==splay_map[max_key]==max_valueTrue>>>list(avl_map)==list(red_black_map)==list(splay_map)==sorted(keys)+[max_key]True>>>prev_max_key,prev_max_value=items[max(range(size),key=keys.__getitem__)]>>>avl_map.prev(max_key)==red_black_map.prev(max_key)==splay_map.prev(max_key)==prev_max_valueTrue>>>avl_map.next(prev_max_key)==red_black_map.next(prev_max_key)==splay_map.next(prev_max_key)==max_valueTrue>>>delavl_map[max_key],red_black_map[max_key],splay_map[max_key]>>>len(avl_map)==len(red_black_map)==len(splay_map)==sizeTrue>>>max_keynotinavl_mapandmax_keynotinred_black_mapandmax_keynotinsplay_mapTrue>>>list(avl_map)==list(red_black_map)==list(splay_map)==sorted(keys)True>>>avl_map.max()==red_black_map.max()==splay_map.max()==values[max(range(size),key=keys.__getitem__)]True>>>avl_map.min()==red_black_map.min()==splay_map.min()==values[min(range(size),key=keys.__getitem__)]True>>>avl_map[max_key]=red_black_map[max_key]=splay_map[max_key]=max_value>>>avl_map.popmax()==red_black_map.popmax()==splay_map.popmax()==max_valueTrue>>>avl_map[min_key]=red_black_map[min_key]=splay_map[min_key]=min_value>>>avl_map.popmin()==red_black_map.popmin()==splay_map.popmin()==min_valueTrueDevelopmentBumping versionPreparationInstallbump2version.Pre-releaseChoose which version number category to bump followingsemver
specification.Test bumping versionbump2version--dry-run--verbose$CATEGORYwhere$CATEGORYis the target version number category name, possible
values arepatch/minor/major.Bump versionbump2version--verbose$CATEGORYThis will set version tomajor.minor.patch-alpha.ReleaseTest bumping versionbump2version--dry-run--verbosereleaseBump versionbump2version--verbosereleaseThis will set version tomajor.minor.patch.Running testsInstall dependenciespython-mpipinstall-rrequirements-tests.txtPlainpytestInsideDockercontainer:withCPythondocker-compose--filedocker-compose.cpython.ymlupwithPyPydocker-compose--filedocker-compose.pypy.ymlupBashscript:withCPython./run-tests.shor./run-tests.shcpythonwithPyPy./run-tests.shpypyPowerShellscript:withCPython.\run-tests.ps1or.\run-tests.ps1cpythonwithPyPy.\run-tests.ps1pypy