rmg study group · 9/20/2013 1. why the rmg study group? §devoted to rmg-py ... §to use, add...

32
RMG Study Group Session I: Git, Sphinx, webRMG Connie Gao 9/20/2013 1

Upload: others

Post on 10-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

RMGStudyGroupSessionI:Git,Sphinx,webRMG

ConnieGao9/20/2013

1

Page 2: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

WhytheRMGStudyGroup?

§ DevotedtoRMG-Py§ HelpnewuserslearnhowtosetupRMG§ Existingusersanddeveloperscandiscussspecificsincode

§ RMG-Py documentationgetswrittenbeforeeachsession!(excepttoday’ssession)

2

Page 3: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Today’sTopics

§ Git:theversioncontroltoolforRMG§ Sphinx:toolforcreatingdocumentation§ webRMG:onlinetoolsforworkingwithRMG

3

Page 4: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

KeyURLs

§ http://www.github.com/GreenGroup§ Git repositoryofallRMG-Py code

§ http://greengroup.github.io/RMG-Py/§ OnlineversionofthecurrentRMG-Py documentation

§ http://rmg.mit.edu§ OfficialRMG-Py documentation,thermodynamicsandkineticsdatabasebrowser,andwebtools

§ http://dev.rmg.mit.edu§ Developmentalversionofrmg.mit.edu withlatestfeaturesandpotentialbugs

§ Touse,add18.172.0.124 dev.rmg.mit.edu tohostsfileinyouroperatingsystem

4

Page 5: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Git5

Page 6: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Git

§ Git isaversioncontroltool§ Multipleuserscaneditmultiplecopiesofcode§ Singleusercancreatemultiplebranchesforasinglerespository

§ Onlinedetailedtutorial:§ http://git-scm.com/book

§ Wheretofindprogramstohelpyouusegit:§ http://git-scm.com/downloads

6

Page 7: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

BasicGit Workflow

1. Modify filesinyourworkingdirectory.2. Stage files,addingsnapshotsofthemto

yourstagingarea.3. Makeacommit,whichtakesthefilesas

theyareinthestagingareaandstoresthatsnapshotpermanentlytoyourGit directory.

7

Page 8: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Git filelifecycle

Notes:Ifaparticularversionofafileisinthegit directory,it’sconsideredcommitted.Ifit’smodifiedbuthasbeenaddedtothestagingarea,itisstaged.Ifitwaschanged sinceitwascheckedoutbuthasnot beenstaged,itismodified.

8

Page 9: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Gettingstarted:createalocalrepo

Twocommonscenarios:(onlydooneofthese)a) Tocloneanalreadyexistingrepotoyourcurrent

directory:$ git clone <url> [local dir name]Thiswillcreateadirectorynamedlocaldir name,containingaworkingcopyofthefilesfromtherepo,anda.git directory(usedtoholdthestagingareaandyouractualrepo)

b) TocreateaGit repoinyourcurrentdirectory:$ git initThiswillcreatea.git directoryinyourcurrentdirectory.Thenyoucancommitfilesinthatdirectoryintotherepo:$ git add file1.java$ git commit –m “initial project version”

9

Page 10: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

CommonGit commands

10

Page 11: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

YoucandoallofthisusingGit-cola:apowerfulGUIinterface

Commitorrevertspecificlines.Stagefilesandwritecommitmessagesgraphically.Amendcommits.

11

Page 12: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Git-cola:apowerfulGUInterface

Visualizepastcommithistoryandrepositorybranches.(Greatfortrackingspecificcodechanges.)

AvailableforWindows,Mac,andLinux!

12

Page 13: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Stepsforgettingstartedwithgit andRMG-Py

1. Clone theRMG-Py git repositoryontoyourlocaldirectory(orontoaserversuchasPharoswhichhasalltheRMG-Pydependenciesaswellasgit preinstalled)

2. Aftermakingchangestocode,testtoensurenothingisbroken

3. Rungit pullofficialmastertopullinlatestofficialcommits4. Stage yourmodifiedfilesandmakeacommit ofyour

changes,withausefulcommitmessage5. Push thecommittoyourgithub repository

Note:PostissuesandbugsinthecodetotheRMG-Py issuespageongithub sootherscanhelpyouaddressyourproblemhttps://github.com/GreenGroup/RMG-Py/issues

13

Page 14: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

14

Page 15: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Sphinx

§ Toolforcreatingintelligent andbeautifuldocumentation

§ OutputformatsinbothHTMLandLaTeX PDF§ UsesreStructuredText asitsmarkuplanguage

15

Page 16: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

RMG-Py documentation

§ LocatedinRMG-Py/documentationfolder§ Howtobuild:

§ Run‘makedocumentation’inparentRMG-PyfolderwillbuildtheHTMLpages

§ Or,gotodocumentationfolderandrun‘makehtml’tomakeHTMLpagesor‘makelatexpdf’tocreatethepdf versionofthedocumentation

§ Editthefilesinsidethedocumentation/sourcefolder

16

Page 17: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

reStructuredText Basics§ PrimerforreS:

§ http://sphinx-doc.org/rest.html#rst-primer§ ExampleofSphinxmarkup:

17

Page 18: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

ExamplemarkupconvertedtoHTML:

18

Page 19: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Usingpythonfunctionreferencesindocumentation

§ FunctioncommentscanbeimportedtoSphinxdocumentationautomatically

19

ORIGINAL CODERMG-Py/rmgpy/statmech/vibration.pyx

Page 20: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

20

DOCUMENTATION SOURCERMG-Py/documentation/source/reference/statmech/harmonicoscillator.rst

Thislinepullsoriginalfunctiondocstring intodocumentationautomatically

…butyoucanappendonmoreinformationorequationsthanthedocstring bywritingadditionaldocumentationhere

Page 21: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

21

DOCUMENTATION HTML PAGERMG-Py/documentation/build/html/reference/statmech/harmonicoscillator.rst

Thispagehasthecombinedpythondocstring informationaswellastheextradocumentationyouadded

NOTE:Theofficialgithub documentationpagesforRMG-Py automaticallyupdatewhenchangesaremadetothecodedocstrings,soyoudon’thavetodoanyextrawork

Page 22: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

StepsforwritingRMG-Py documentation

1. Createandeditnewdocumentationpages(.rstfiles)locally.Usecodereferenceswhereappropriatetosavetime.

2. Buildhtmlpageslocallytopreviewthatthepagesaresatisfactoryinlayout.

3. Usegit tocommit thesource.rst filesthatyoumodifiedtotheRMG-Py github repository.

4. Youaredone!OfficialRMG-Py documentationpageswillbeupdatedautomatically.

22

Page 23: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

23

webRMG

Page 24: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

webRMG

§ URLs:§ Officialversion:http://rmg.mit.edu§ Development(newer)version:http://dev.rmg.mit.edu

§ MakeRMG’sdatabasesmoretransparent,accessible,andmodifiable

§ Webtoolsforvisualizingkineticsandreactionsmoreeasily

§ BuiltonaDjango pythonframeworkwhichqueriestheRMG-Py codeitself!

24

Page 25: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

Features

25

Page 26: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ Editingoraddingnewratesorthermodatatothedatabase§ Editsourceonlinewithaccount§ Changesmakeanautomaticcommitongithub

§ CommitgetsreviewedbyGreenGroupmembersbeforebeingpublishedtoofficial

§ ExportdatabaseforRMG-Java§ ConvertsRMG-Py databasetoRMG-Javadatabaseformat

§ Exportscurrentversionofdatabaseonwebsitein.zipor.tar.gzformat

26

Page 27: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ UseanyidentifierandconvertittoanadjacencylistusedinRMG§ SMILES§ InChI§ Commonchemicalnames

§ Previewmoleculewhileeditingadjacencylist§ Viewmoleculedata:

§ Molecularweight,identifiers,thermo

27

Page 28: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ ComparekineticsinmodelwithkineticsfoundinRMG’sdatabases§ Displaysmatchingreactionlibraryresults,rateestimatesfromRMG-JavaandRMG-Py,identifiesraterulecontributions,linkstosources

§ ToolbarforsearchingNISTdatabaseautomaticallyfillsinreactantandproductfields

§ CompareratesatagivenT

28

Page 29: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ Modelvisualization(RMG-Py andJavafriendly)§ VisualizeamodelgeneratedfromRMGusingitschemkin fileandRMGdictionaryonHTMLpage

§ ClickinganyreactionlinksearchesRMGdatabaseforreactionkinetics

§ Clickingonanymolecule’simagegivesadditionalinfoandlinktothermochemistry

§ Modelcomparison(RMG-Py andJavafriendly)§ Comparetwomodelsagainsteachother§ Identifycommonvs.uniquespeciesandreactions§ Identifysimilaritiesordifferencesinthermoandkinetics

29

Page 30: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ Fluxdiagramgeneration(RMG-Py andJavafriendly)§ CreatevideoofareactionnetworkusingRMGconditionfile,chemkin file,andRMGdictionary

§ Canoptionallyusechemkin outputfileforanon-isothermalsimulation(maycurrentlybebroken)

§ PopulateReactions(RMG-Py only)§ Generatealistofallreactionsoccurringgivenasetofinitialspecieslistedinaconditionfile(producesthesetofedgereactionsinasimulation)

30

Page 31: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ Plotforwardandreversekinetics(RMG-Py andJavafriendly)§ Usechemkin fileandRMGdictionary(optional)togenerateplotsofforwardandreversereactionkinetics

§ CreateRMG-JavaKineticsLibrary§ Convertachemkin fileandRMGdictionaryintoaRMG-Javakineticslibrary

§ Mergemodels§ Generatemergedchemkin fileandRMGdictionaryfor2models

31

Page 32: RMG Study Group · 9/20/2013 1. Why the RMG Study Group? §Devoted to RMG-Py ... §To use, add 18.172.0.124 dev.rmg.mit.eduto hosts file in your operating system 4. Git 5. Git §Gitis

§ CreateInputFile(RMG-Py only)(maycurrentlybebroken)§ UsewebformtogenerateinputfileforaRMGjobormodifyanexistinginputfile

§ Moreuserfriendlyandlesserrorpronethanworkingwithsourcecode

§ Providesfilled-invaluesasrecommendationsforadvancedoptionsintheinputfile

32