Skip to content

Commit

Permalink
code text, excluding incomplete sections
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed Jul 29, 2024
1 parent ec6f9ad commit ac54d49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions 02_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ numbering:
enumerator: 1.%s
---

Python has inarguably become the leading programming language in the scientific community, continually gaining popularity for the past two decades. This is due to Python being friendly for beginners, owing to its less strict language structure (dynamic typing, automatic memory management, non-compiled language) and the plethora of tutorials and examples. It also benefits from being free (this text would be less accessible if it required a licence), with numerous high quality libraries covering a broad range of applications (numeric calculations, image analysis, machine learning, ...), including a number of packages dedicated to S/TEM. The diverse and broad scope of the python ecosystem allows for interoperability between different domains, and file formats as well as easily re-purposing existing implementations algorithms to new domains.
Python has inarguably become the leading programming language in the scientific community, continually gaining popularity for the past two decades.
This is due to Python being friendly for beginners, owing to its less strict language structure (dynamic typing, automatic memory management, non-compiled language) and the plethora of tutorials and examples.
It also benefits from being open-source, with numerous high quality libraries covering a broad range of applications (numeric calculations, image analysis, machine learning, etc.), including a number of packages dedicated to S/TEM.
The diverse and broad scope of the python ecosystem allows for interoperability between different domains, and file formats as well as easily re-purposing existing implementations algorithms to new domains.

There are a number of codes dedicated to S/TEM:
- *ab*TEM - all-Python S/TEM image simulation
Expand All @@ -20,9 +23,11 @@ The main libraries used in the code examples of this text are:
- NumPy (np) - fast numerical calculations
- CuPy (cp) - drop-in replacement for NumPy to run on GPUs
- Numba - just-in-time Python compiler for scientific and array-oriented computing
- matplotlib - all things plotting
- matplotlib - plotting and visualization
- ipywidgets - making interactive figures
- ASE (Atomic Simulation Environment) - creating and visualizing atomic structures
- Atomic Simulation Environment (ASE) - creating and visualizing atomic structures
- ...

Dynamically interpreted languages including Python are particularly attractive for domain experts and scientists trying out new ideas, but the performance of the interpreter can be a barrier to high performance. However, by making appropriate use of Python open-source numerical libraries including NumPy, CuPy, and Numba, it is possible to write a purely Python-based code that performs as well or even better than prior codes based on traditional languages such C++ or Fortran. That is indeed what *ab*TEM has been able to achieve, which has made it one of the fastest-growing and popular tools for S/TEM simulations, and our choice for this text.
Dynamically interpreted languages including Python are particularly attractive for domain experts and scientists trying out new ideas, but the performance of the interpreter can be a barrier to high performance.
However, by making appropriate use of Python open-source numerical libraries including NumPy, CuPy, and Numba, it is possible to write a purely Python-based code that performs as well or even better than prior codes based on traditional languages such C++ or Fortran.
That is indeed what *ab*TEM has been able to achieve, which has made it one of the fastest-growing and popular tools for S/TEM simulations, and our choice for this text.
2 changes: 2 additions & 0 deletions myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ project:
- format: meca
exclude:
- README.md
- 06_sim_inputs.md
- 11_errors.md
- main.md
- original/*
abbreviations:
Expand Down

0 comments on commit ac54d49

Please sign in to comment.