Effective Computation in Physics - Helion
ISBN: 978-14-919-0158-8
stron: 552, Format: ebook
Data wydania: 2015-06-25
Księgarnia: Helion
Cena książki: 126,65 zł (poprzednio: 147,27 zł)
Oszczędzasz: 14% (-20,62 zł)
More physicists today are taking on the role of software developer as part of their research, but software development isn’t always easy or obvious, even for physicists. This practical book teaches essential software development skills to help you automate and accomplish nearly any aspect of research in a physics-based field.
Written by two PhDs in nuclear engineering, this book includes practical examples drawn from a working knowledge of physics concepts. You’ll learn how to use the Python programming language to perform everything from collecting and analyzing data to building software and publishing your results.
In four parts, this book includes:
- Getting Started: Jump into Python, the command line, data containers, functions, flow control and logic, and classes and objects
- Getting It Done: Learn about regular expressions, analysis and visualization, NumPy, storing data in files and HDF5, important data structures in physics, computing in parallel, and deploying software
- Getting It Right: Build pipelines and software, learn to use local and remote version control, and debug and test your code
- Getting It Out There: Document your code, process and publish your findings, and collaborate efficiently; dive into software licenses, ownership, and copyright procedures
Osoby które kupowały "Effective Computation in Physics", wybierały także:
- Data Science w Pythonie. Kurs video. Przetwarzanie i analiza danych 149,00 zł, (67,05 zł -55%)
- Excel 2013. Kurs video. Poziom drugi. Przetwarzanie i analiza danych 79,00 zł, (35,55 zł -55%)
- Zarz 99,00 zł, (49,50 zł -50%)
- Eksploracja danych za pomoc 67,00 zł, (33,50 zł -50%)
- Google Analytics od podstaw. Analiza wp 69,00 zł, (34,50 zł -50%)
Spis treści
Effective Computation in Physics eBook -- spis treści
- Foreword
- Preface
- What Is This Book?
- Who This Book Is For
- Who This Book Is Not For
- Case Study on How to Use This Book: Radioactive Decay Constants
- Accessing Data and Libraries
- Creating a Simple Program
- Automating Data Collection
- Analyzing and Plotting the Data
- Keeping Track of Changes
- Testing the Code
- Documenting the Code
- Publishing
- What to Do While Reading This Book
- Conventions Used in This Book
- Using Code Examples
- Installation and Setup
- Step 1: Download and Install Miniconda (or Anaconda)
- Step 2: Install the Packages
- Safari Books Online
- How to Contact Us
- Acknowledgments
- I. Getting Started
- 1. Introduction to the Command Line
- Navigating the Shell
- The Shell Is a Programming Language
- Paths and pwd
- Home Directory (~)
- Listing the Contents (ls)
- Changing Directories (cd)
- File Inspection (head and tail)
- Manipulating Files and Directories
- Creating Files (nano, emacs, vi, cat, >, and touch)
- GUIs for file creation
- Creating an empty file (touch)
- The simplest text editor (cat and >)
- More powerful text editors (nano, emacs, and vim)
- Copying and Renaming Files (cp and mv)
- Making Directories (mkdir)
- Deleting Files and Directories (rm)
- Flags and Wildcards
- Creating Files (nano, emacs, vi, cat, >, and touch)
- Getting Help
- Reading the Manual (man)
- Arguments, options, and variables
- Moving around in less
- Finding the Right Hammer (apropos)
- Combining Utilities with Redirection and Pipes (>, >>, and |)
- Reading the Manual (man)
- Permissions and Sharing
- Seeing Permissions (ls -l)
- Setting Ownership (chown)
- Setting Permissions (chmod)
- Creating Links (ln)
- Connecting to Other Computers (ssh and scp)
- The Environment
- Saving Environment Variables (.bashrc)
- Running Programs (PATH)
- Nicknaming Commands (alias)
- Scripting with Bash
- Command Line Wrap-up
- Navigating the Shell
- 2. Programming Blastoff with Python
- Running Python
- Comments
- Variables
- Special Variables
- Boolean Values
- None Is Not Zero!
- NotImplemented Is Not None!
- Operators
- Strings
- String Indexing
- String Concatenation
- String Literals
- String Methods
- Modules
- Importing Modules
- Importing Variables from a Module
- Aliasing Imports
- Aliasing Variables on Import
- Packages
- The Standard Library and the Python Ecosystem
- Python Wrap-up
- 3. Essential Containers
- Lists
- Tuples
- Sets
- Dictionaries
- Containers Wrap-up
- 4. Flow Control and Logic
- Conditionals
- if-else Statements
- if-elif-else Statements
- if-else Expression
- Exceptions
- Raising Exceptions
- Loops
- while Loops
- for Loops
- Comprehensions
- Flow Control and Logic Wrap-up
- Conditionals
- 5. Operating with Functions
- Functions in Python
- Keyword Arguments
- Variable Number of Arguments
- Multiple Return Values
- Scope
- Recursion
- Lambdas
- Generators
- Decorators
- Function Wrap-up
- 6. Classes and Objects
- Object Orientation
- Objects
- Classes
- Class Variables
- Instance Variables
- Constructors
- Methods
- Static Methods
- Duck Typing
- Polymorphism
- Subclasses
- Superclasses
- Multiple inheritance
- Decorators and Metaclasses
- Object Orientation Wrap-up
- II. Getting It Done
- 7. Analysis and Visualization
- Preparing Data
- Experimental Data
- Simulation Data
- Metadata
- Loading Data
- NumPy
- PyTables
- Pandas
- Blaze
- Cleaning and Munging Data
- Missing Data
- Analysis
- Model-Driven Analysis
- Data-Driven Analysis
- Visualization
- Visualization Tools
- Gnuplot
- matplotlib
- The gallery
- Bokeh
- Inkscape
- Analysis and Visualization Wrap-up
- Preparing Data
- 8. Regular Expressions
- Messy Magnetism
- Metacharacters on the Command Line
- Listing Files with Simple Patterns
- The wildcard (*)
- Globally Finding Filenames with Patterns (find)
- Representing any character (.)
- Escaping metacharacters (\)
- Finding either one pattern or another (|)
- Character sets ([])
- Listing Files with Simple Patterns
- grep, sed, and awk
- Finding Patterns in Files (grep)
- Finding and Replacing Patterns in Files (sed)
- Finding and Replacing a Complex Pattern
- sed Extras
- Manipulating Columns of Data (awk)
- Python Regular Expressions
- Regular Expressions Wrap-up
- 9. NumPy: Thinking in Arrays
- Arrays
- dtypes
- Slicing and Views
- Arithmetic and Broadcasting
- Fancy Indexing
- Masking
- Structured Arrays
- Universal Functions
- Other Valuable Functions
- NumPy Wrap-up
- 10. Storing Data: Files and HDF5
- Files in Python
- An Aside About Computer Architecture
- Big Ideas in HDF5
- File Manipulations
- Hierarchy Layout
- Chunking
- In-Core and Out-of-Core Operations
- In-Core
- Out-of-Core
- Querying
- Compression
- HDF5 Utilities
- Storing Data Wrap-up
- 11. Important Data Structures in Physics
- Hash Tables
- Resizing
- Collisions
- Data Frames
- Series
- The Data Frame Structure
- B-Trees
- K-D Trees
- Data Structures Wrap-up
- Hash Tables
- 12. Performing in Parallel
- Scale and Scalability
- Problem Classification
- Example: N-Body Problem
- No Parallelism
- Threads
- Multiprocessing
- MPI
- Parallelism Wrap-up
- 13. Deploying Software
- Deploying the Software Itself
- pip
- Conda
- Virtual Machines
- Docker
- Deploying to the Cloud
- Deploying to Supercomputers
- Deployment Wrap-up
- Deploying the Software Itself
- III. Getting It Right
- 14. Building Pipelines and Software
- make
- Running make
- Makefiles
- Targets
- Special Targets
- Building and Installing Software
- Configuration of the Makefile
- Platform configuration
- System and user configuration
- Dependency configuration
- Compilation
- Configuration of the Makefile
- Installation
- Building Software and Pipelines Wrap-up
- make
- 15. Local Version Control
- What Is Version Control?
- The Lab Notebook of Computational Physics
- Version Control Tool Types
- Getting Started with Git
- Installing Git
- Getting Help (git --help)
- Control the Behavior of Git (git config)
- Local Version Control with Git
- Creating a Local Repository (git init)
- Staging Files (git add)
- Checking the Status of Your Local Copy (git status)
- Saving a Snapshot (git commit)
- git log: Viewing the History
- Viewing the Differences (git diff)
- Unstaging or Reverting a File (git reset)
- Discard Revisions (git revert)
- Listing, Creating, and Deleting Branches (git branch)
- Switching Between Branches (git checkout)
- Merging Branches (git merge)
- Dealing with Conflicts
- Version Conrol Wrap-Up
- What Is Version Control?
- 16. Remote Version Control
- Repository Hosting (github.com)
- Creating a Repository on GitHub
- Declaring a Remote (git remote)
- Sending Commits to Remote Repositories (git push)
- Downloading a Repository (git clone)
- Fetching the Contents of a Remote (git fetch)
- Merging the Contents of a Remote (git merge)
- Pull = Fetch and Merge (git pull)
- Conflicts
- Resolving Conflicts
- Remote Version Control Wrap-up
- 17. Debugging
- Encountering a Bug
- Print Statements
- Interactive Debugging
- Debugging in Python (pdb)
- Setting the Trace
- Stepping Forward
- Querying Variables
- Setting the State
- Running Functions and Methods
- Continuing the Execution
- Breakpoints
- Profiling
- Viewing the Profile with pstats
- Viewing the Profile Graphically
- Line Profiling with Kernprof
- Linting
- Debugging Wrap-up
- 18. Testing
- Why Do We Test?
- When Should We Test?
- Where Should We Write Tests?
- What and How to Test?
- Running Tests
- Edge Cases
- Corner Cases
- Unit Tests
- Integration Tests
- Regression Tests
- Test Generators
- Test Coverage
- Test-Driven Development
- Testing Wrap-up
- IV. Getting It Out There
- 19. Documentation
- Why Prioritize Documentation?
- Documentation Is Very Valuable
- Documentation Is Easier Than You Think
- Types of Documentation
- Theory Manuals
- User and Developer Guides
- Readme Files
- Comments
- Self-Documenting Code
- Naming
- Simple functions
- Consistent style
- Docstrings
- Automation
- Sphinx
- Getting started
- Comment style
- Sphinx
- Documentation Wrap-up
- Why Prioritize Documentation?
- 20. Publication
- Document Processing
- Separation of Content from Formatting
- Tracking Changes
- Text Editors
- Markup Languages
- LaTeX
- LaTeX document class
- LaTeX environments
- Building the document
- LaTeX metadata
- Document structure
- Typesetting mathematical formulae
- Tables and figures
- Internal references
- Bibliographies
- Reference management
- LaTeX
- Publication Wrap-up
- Document Processing
- 21. Collaboration
- Ticketing Systems
- Workflow Overview
- Creating an Issue
- Core features of an issue
- Issue metadata
- Assigning an Issue
- Discussing an Issue
- Closing an Issue
- Pull Requests and Code Reviews
- Submitting a Pull Request
- Reviewing a Pull Request
- Merging a Pull Request
- Collaboration Wrap-up
- Ticketing Systems
- 22. Licenses, Ownership, and Copyright
- What Is Copyrightable?
- Right of First Publication
- What Is the Public Domain?
- Choosing a Software License
- Berkeley Software Distribution (BSD) License
- GNU General Public License (GPL)
- Creative Commons (CC)
- Other Licenses
- Changing the License
- Copyright Is Not Everything
- Licensing Wrap-up
- 23. Further Musings on Computational Physics
- Where to Go from Here
- Glossary
- Bibliography
- Index