Package: orient
orientIn 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--upgradeorientDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/orient.gitcdorientInstall dependenciespython-mpipinstall-rrequirements.txtInstallpythonsetup.pyinstallUsage>>>fromground.baseimportget_context>>>context=get_context()>>>Contour=context.contour_cls>>>Point=context.point_cls>>>Polygon=context.polygon_cls>>>Segment=context.segment_cls>>>left_bottom=Point(0,0)>>>right_bottom=Point(4,0)>>>left_top=Point(0,4)>>>right_top=Point(4,4)>>>bottom_segment_midpoint=Point(2,0)>>>bottom_segment=Segment(left_bottom,right_bottom)>>>fromground.baseimportLocation>>>fromorient.planarimportpoint_in_segment>>>point_in_segment(left_bottom,bottom_segment)isLocation.BOUNDARYTrue>>>(point_in_segment(bottom_segment_midpoint,bottom_segment)...isLocation.BOUNDARY)True>>>point_in_segment(right_bottom,bottom_segment)isLocation.BOUNDARYTrue>>>point_in_segment(left_top,bottom_segment)isLocation.EXTERIORTrue>>>square=Contour([left_bottom,right_bottom,right_top,left_top])>>>fromorient.planarimportpoint_in_region>>>point_in_region(left_bottom,square)isLocation.BOUNDARYTrue>>>point_in_region(Point(1,1),square)isLocation.INTERIORTrue>>>point_in_region(right_top,square)isLocation.BOUNDARYTrue>>>point_in_region(Point(5,5),square)isLocation.EXTERIORTrue>>>main_diagonal=Segment(left_bottom,right_top)>>>fromground.baseimportRelation>>>fromorient.planarimportsegment_in_region>>>segment_in_region(bottom_segment,square)isRelation.COMPONENTTrue>>>(segment_in_region(Segment(Point(1,0),Point(5,0)),square)...isRelation.TOUCH)True>>>segment_in_region(main_diagonal,square)isRelation.ENCLOSEDTrue>>>(segment_in_region(Segment(Point(1,1),Point(2,2)),square)...isRelation.WITHIN)True>>>(segment_in_region(Segment(Point(1,1),Point(5,5)),square)...isRelation.CROSS)True>>>inner_square=Contour([Point(1,1),Point(3,1),Point(3,3),...Point(1,3)])>>>fromorient.planarimportregion_in_region>>>region_in_region(square,square)isRelation.EQUALTrue>>>region_in_region(inner_square,square)isRelation.WITHINTrue>>>region_in_region(square,inner_square)isRelation.COVERTrue>>>fromorient.planarimportpoint_in_polygon>>>point_in_polygon(left_bottom,Polygon(square,[]))isLocation.BOUNDARYTrue>>>point_in_polygon(Point(1,1),Polygon(square,[]))isLocation.INTERIORTrue>>>point_in_polygon(Point(2,2),Polygon(square,[]))isLocation.INTERIORTrue>>>(point_in_polygon(Point(1,1),Polygon(square,[inner_square]))...isLocation.BOUNDARY)True>>>(point_in_polygon(Point(2,2),Polygon(square,[inner_square]))...isLocation.EXTERIOR)True>>>fromorient.planarimportsegment_in_polygon>>>(segment_in_polygon(bottom_segment,Polygon(square,[]))...isRelation.COMPONENT)True>>>(segment_in_polygon(Segment(Point(1,0),Point(5,0)),Polygon(square,[]))...isRelation.TOUCH)True>>>segment_in_polygon(main_diagonal,Polygon(square,[]))isRelation.ENCLOSEDTrue>>>(segment_in_polygon(main_diagonal,Polygon(square,[inner_square]))...isRelation.CROSS)True>>>(segment_in_polygon(Segment(Point(1,1),Point(2,2)),Polygon(square,[]))...isRelation.WITHIN)True>>>segment_in_polygon(Segment(Point(1,1),Point(2,2)),...Polygon(square,[inner_square]))isRelation.TOUCHTrue>>>(segment_in_polygon(Segment(Point(1,1),Point(5,5)),Polygon(square,[]))...isRelation.CROSS)True>>>segment_in_polygon(Segment(Point(1,1),Point(5,5)),...Polygon(square,[inner_square]))isRelation.CROSSTrue>>>fromorient.planarimportpolygon_in_polygon>>>(polygon_in_polygon(Polygon(square,[]),Polygon(square,[]))...isRelation.EQUAL)True>>>(polygon_in_polygon(Polygon(inner_square,[]),Polygon(square,[]))...isRelation.WITHIN)True>>>(polygon_in_polygon(Polygon(square,[]),Polygon(inner_square,[]))...isRelation.COVER)True>>>polygon_in_polygon(Polygon(inner_square,[]),...Polygon(square,[inner_square]))isRelation.TOUCHTrue>>>polygon_in_polygon(Polygon(square,[inner_square]),...Polygon(inner_square,[]))isRelation.TOUCHTrueDevelopmentBumping 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