Agenda for July 26 (Tuesday):
- PyCharm
- Presentation (@liamhuber)
- Homework check: verify that PyCharm is installed and has access to a pyiron-capable interpreter
- Download a demo notebook
- New Project
- Create a new project from scratch
- Choose our pyiron conda env (or create a new env if they failed homework)
- Open "Python Packages" window and verify that the env uses
https://conda.anaconda.org/conda-forge/
as its only repository, and that the latest versions ofpyiron
andjupyter
installed (or set and install if they failed homework)
- Move the notebook into project
- Launch jupyter from PyCharm terminal (or within PyCharm if you have pro version)
- Walk through the notebook
- Create a new project from scratch
- From Notebook To Module
- Create a python module inside the project
- Move functions to .py
- Walk through highlighting:
- Red -- we misnamed an internal variable! Hard to spot in notebook
- Yellow -- PyCharm automatically helps you follow PEP8 and other styles
- Greyed out -- Unused variables are easy to find
- Introduce find/replace in files to rename functions
XY_energy
->xy_energy
- Introduce refactor menu: rename
XY_structure
toxy_structure
- Warning: Be careful with refactoring! It might operate on a wider scope than you expect. Show how to preview and how to read the preview
- Import in notebook and re-run
- Refactor out a minimization function
- Note extra variable highlighting on
host
- Note tab completion for known (i.e. in-scope) variables
- Note extra variable highlighting on
- Import in notebook, adjust, and re-run
- Add a master
binding_energy
method calling the other four- Note "Structure" tab and show different ways to sort it
- Introduce "find usages", even though it's pretty trivial here
- Import in notebook, adjust, and re-run
- Note re-use of variables, ask about introducing pressure, or deleting existing jobs... time permitting we would introduce a class for this job
- Development with Git
- Clone
pyiron_contrib
onto local machine - Make a new project here from existing sources
- Show how to make PyCharm conda envs private/public
- Check out
tutorial
branch - Make a new branch off that
- Add an empty file to hold the workflow you will make later in the workshop
- Commit and push
- Clone
- Learning objectives:
- Manage your python (conda) environment from inside PyCharm
- Recognize and use Editor features: syntax highlighting, error highlighting, autocompletion
- Navigate PyCharm using the Project and Structure tabs and by control-clicking
- Use Git from directly within PyCharm: create, pull, commit, push,
merge(do later), fetch - Know the difference between searching content by usage and by string matching and be able to do both
- Know where to find the refactoring tab, and use it for simple tasks like renaming variables
- Presentation (@liamhuber)
pyiron_base
(@jan-janssen)Project
job.status
job.run
(how different runs are related tojob.status
)job.server
job.executable
GenericMaster
pyiron_atomistics
(@samwaseda)- LAMMPS
- VASP
- SPHInX
- Murnaghan
- Writing own workflows (all) ~1h
- Presentation of workflows on GitHub
Agenda for July 27 (Wednesday)
- GitHub (Comments on PR, issues, review etc.) (@srmnitc)
- Getting a dev environment setup on the cluster (@prmv)
- local check out of repositories
- remote and local debugging and profiling
- Refactoring (@niklassiemer)
- pycharm tools
- pycharm highlighting
- pep8
- zen of python and where to find it
- Unit tests & DocStrings (@pmrv)
- Correct + peer-review of PRs (from Day I)
- Introduction to easy issues (cf. issue page)
- Discussion
- Invitation to pyiron meetings
Homework: before coming they should
- go on google and know the following terms in the context of python: "function", "argument", "class", "method", "property", "module". Bonus term: "decorator"
- install pycharm
- install conda
- install pyiron (
conda install pyiron
)
Feel free to modify this post if necessary.