Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and...
Transcript of Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and...
![Page 1: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/1.jpg)
HarnessingthePowerofPythoninArcGISUsingtheCondaDistributionShaunWalbridge
ClintonDow
![Page 2: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/2.jpg)
https://github.com/scw/conda-devsummit-2017-talk
HighQualityPDF
![Page 3: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/3.jpg)
Conda
![Page 4: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/4.jpg)
GettingtoPackages
![Page 5: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/5.jpg)
WhyPackages?Softwareiscomposedofmanysmallercomponents,oftencalledpackagesorlibraries.It’softenbettertoreusecodethatsolvesaproblemwellratherthanrecreatingitBut,sharingcodeisahardproblem.Doyouhavethesamepackagesofthesameversionsasthedeveloperdid?
![Page 6: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/6.jpg)
PackageManagementforPython
Whynotpip,wheels,virtualenvs?
Don’thandletheharderproblemofsystemdependencies,consideredoutofscopebyPythonpackagers–doesitendupinsite-packages?Packagedevs:OnOSXandLinux,‘easy’togetthedeps!Useasystempackagemanager(e.g.apt,brew,yum)andtheincludedcompiler(e.g.clang,gcc).It’sstillnoteasytomakereproduciblebuilds,andwhataboutthatotherplatform?
![Page 7: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/7.jpg)
WhyConda?
ScientificPythoncommunityidentifiedthattherewasagapnotbeingaddressedbythecorePythoninfrastructure,limitingtheirabilitytogetpackagesintothehandsofusers
Industrystandardbuiltbypeoplewhocareaboutthisspace—ContinuumAnalytics
![Page 8: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/8.jpg)
WhyConda?
Itsolvesthehardproblem:
HandlesdependenciesformanylanguagesBuiltforPythonfirst,butitreallysolvesamuchbroaderinfrastructuralissue.
Gatewaytodatascience—scientific,analytics,integratedsoftwareecosystemfororganizations
![Page 9: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/9.jpg)
Interlude:ReviewingReviews
![Page 10: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/10.jpg)
ReviewingReviews
![Page 11: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/11.jpg)
ReviewingReviewsscore=(ratings.sum(axis=1)+inverse_ratings.sum(axis=1)*5)"""104130.0103430.0103629.0103927.0103826.0103726.0104025.0104224.0103515.0"""#1035,let'sseeiftheyleftusacommentdf_conda.loc[1035]['Comments']
Therewasnorealbasicexplanationofwhatcondadoes…justapackageandenvmanager.
![Page 12: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/12.jpg)
ReviewingReviewsIfyoudon’tagreewithsomeone,trywalkingamile
intheirshoes…
…becausethenyou’llbeamileawayfromthem,andyou’llhavetheirshoes.—TerryPratchett
![Page 13: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/13.jpg)
![Page 14: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/14.jpg)
Fundamentals
![Page 15: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/15.jpg)
FundamentalsConsistentbuildingofpackages(Windows,Linux,MacOS),publicandprivatesharingCrossplatform,andcross-langauge—handlesC/C++,R,Java,Scala,JavascriptandmanymoreUltimatelyrealizedasacollectionoffilesinanarchive,andruleswhichdictatepackagedependenciesOpensource:Esriisusingit,youcanuseitinyourownprojectsforothercontexts
![Page 16: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/16.jpg)
Environments—AcollectionofpackagesandPythoninstalliscalledanenvironment,thebuildingblockformanagingPythonwithCondaFlexiblymakechangeswithoutaffectinginstalledsoftwareCancreatemultipleenvironmentsandswitchseamlessly
Requirements—includeexplicitstateinformation,notjustthepackagename.
![Page 17: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/17.jpg)
WheredoIgetpackages?Condapackagescancomefromavarietyoflocations:
PublicrepositorieshostedonPublicrepositoriesself-hostedPrivaterepositories
OndiskChannels—
AcollectionofpackagesownedbyauserororganizationConfigureCondatolookattheselocations(.condarcfile)
AnacondaCloud
AnacondaEnterprise
![Page 18: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/18.jpg)
Demo:UsingPackages
![Page 19: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/19.jpg)
CondaBasicsActivatingenvironments,acoupleways:
UsetheshortcutsincludedinProManuallyactivatetheenvironment:
cdC:\ArcGIS\bin\Python\Scriptsactivatearcgispro-py3
![Page 20: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/20.jpg)
CondaBasics
Condainfoisthestartingpoint—ittellsyouthestateoftheenvironment.
conda--help
condainfo
![Page 21: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/21.jpg)
CondaBasicscondalist
#packagesinenvironmentatC:\ArcGIS\bin\Python\envs\arcgispro-py3:#colorama0.3.7py35_0defaultscycler0.10.0py35_0defaultsfuture0.15.2py35_0defaultsmatplotlib1.5.3np111py35_0e[arcgispro]esrimpmath0.19py35_1defaultsnetcdf41.2.4py35_0e[arcgispro]esrinose1.3.7py35_1defaultsnumexpr2.6.1np111py35_0e[arcgispro]esrinumpy1.11.2py35_0e[arcgispro]esripandas0.19.0np111py35_0defaultspip8.1.2py35_0defaultspy1.4.31py35_0defaultspyparsing2.1.4py35_0defaultspypdf21.26.0py_0esripytest2.9.2py35_0defaultspython3.5.20defaultspython-dateutil2.5.3py35_0defaultspytz2016.6.1py35_0defaultsrequests2.11.1py35_0defaultsscipy0.18.1np111py35_0e[arcgispro]esrisetuptools27.2.0py35_1defaultssympy1.0py35_0defaultswheel0.29.0py35_0defaults
![Page 22: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/22.jpg)
DeeperDive
![Page 23: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/23.jpg)
CondaPackagingOK,sohowdowemakeanewpackage?
whichdescribestheinstructionstobuildthesoftware
WheredoIgetthecode?Whatarewebuilding,andwhatdoesitdependon?Runcondabuildtocreateapackagefromthisrecipe
Createarecipe
![Page 24: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/24.jpg)
CondaPackagingmeta.yaml
package:name:conda-devsummit-2017-talkversion:"1.0"
source:git_url:https://github.com/scw/conda-devsummit-2017-talk.git
requirements:run:-python-scikit-learn
![Page 25: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/25.jpg)
CondaPackagingBuildthepackage:
Uploadandshare:
condabuildc:\example\mypackage
anacondauploadmypackage
![Page 26: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/26.jpg)
Demo:CondaPackaging
![Page 27: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/27.jpg)
PythonPackageManager
![Page 28: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/28.jpg)
HowcanIusethis?WealreadyshipyoutheSciPystack—powerfulandoutoftheboxinallproductsCondacommandandaCondarootPythoninstallNewmodules(e.g.requests),environmentwithPro
PythonPackageManagerinProGetpackages,expandyourpossibilityspacePackageyourwork:thisisanopportunitytodistributeit
![Page 29: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/29.jpg)
WhereCanIRunThis?
ArcGISPro1.3CondaisthePythoninstall,includedforall
ArcGISPro1.4PythonPackageManagerPython3.5withcurrentpackageset
ArcGISEnterprise10.5ArcGISAPIforPython
![Page 30: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/30.jpg)
fromfutureimport*ArcGISPro2.0:
ManageenvironmentsandchannelsResettableenvironment“μConda”
![Page 31: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/31.jpg)
Resources
![Page 32: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/32.jpg)
OtherSessionsWeds4:00PM,SanJacinto
Weds4:00,DemoTheater1
Weds4:30PM,DemoTheater1
Thurs10:30AM,MesquiteG-H
GettingDataSciencewithRandArcGIS
DeployingYourGeoprocessingToolsasPythonModules
PythonPackageManagementUsingConda
ContinuumAnalytics:ExploringContinuumAnalytics’Open-SourceOfferings
![Page 33: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/33.jpg)
Condavs…Name Means Included?
Thecommanditself ✓AminimumsetofPythonpackagestobuildandrunConda.
✓
Adistribution200+packagesandrunConda
Self-hosted,distributedandHPCadditions
Conda
Miniconda
Anaconda
AnacondaWorkgroup
![Page 34: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/34.jpg)
ResourcesCondaCheatsheetAnaconda.orgCondaRecipesHarnessingthePowerofPythoninArcGISUsingtheCondaDistributionUnderstandingCondabyJakeVanderplasSecurityupdatesforPythondepdendencies
![Page 35: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/35.jpg)
Closing
![Page 36: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/36.jpg)
ThanksEsriCondaTeam:
ContinuumAnalyticsforcreatingandopensourcingConda
![Page 37: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/37.jpg)
RateThisSessioniOS,Android:Feedbackfromwithintheapp
Bewarnedthatwemayincorporatefeedbackintonextyear’ssession
![Page 38: Harnessing the Power of Python in ArcGIS Using the Conda ... · Getting Data Science with R and ArcGIS ... Harnessing the Power of Python in ArcGIS Using the Conda Distribution Understanding](https://reader034.fdocuments.in/reader034/viewer/2022042218/5ec457a01b32702dbe2c9cfd/html5/thumbnails/38.jpg)