Skip to content

Commit

Permalink
Add workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
lang-m committed May 27, 2022
0 parents commit 8b004a6
Show file tree
Hide file tree
Showing 32 changed files with 70,697 additions and 0 deletions.
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright 2020, Marijan Beg and Hans Fangohr

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROJECT=workshop
IPYNBPATH=tutorials/*.ipynb
PYTHON?=python3

test-ipynb:
$(PYTHON) -m pytest -v --nbval-lax $(IPYNBPATH)

test-pycodestyle:
$(PYTHON) -m pycodestyle --filename=*.py .

test-all: test-ipynb test-pycodestyle

test-all-travis: test-ipynb test-pycodestyle

travis-build: SHELL:=/bin/bash
travis-build:
docker build -f docker/Dockerfile -t dockertestimage .
docker run -e ci_env -ti -d --name testcontainer dockertestimage
docker exec testcontainer make test-all-travis
docker stop testcontainer
docker rm testcontainer

test-docker:
docker build -f docker/Dockerfile -t dockertestimage .
docker run -ti -d --name testcontainer dockertestimage
docker exec testcontainer find . -name '*.pyc' -delete
docker exec testcontainer make test-all-travis
docker stop testcontainer
docker rm testcontainer
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Workshop: Micromagnetics with Ubermag
Marijan Beg<sup>1,2</sup>, Ondrej Hovorka<sup>1</sup>, and Hans Fangohr<sup>2,1</sup>

<sup>1</sup> *Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, United Kingdom*
<sup>2</sup> *European XFEL GmbH, Holzkoppel 4, 22869 Schenefeld, Germany*

| Description | Badge |
| --- | --- |
| Builds | [![Build Status](https://travis-ci.org/ubermag/workshop.svg?branch=master)](https://travis-ci.org/ubermag/workshop) |
| Binder | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ubermag/workshop/master?urlpath=lab/tree/tutorials/index.ipynb) |
| License | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) |
| Zoom | [![Zoom_ID 74465485256](https://img.shields.io/badge/Zoom_ID-74465485256-brightgreen.svg)](https://us04web.zoom.us/j/74465485256) |

## About

This repository is a place where all the materials (slides, tutorials, and exercises) used in Ubermag workshops are stored.

1. The slides (as PDF) can be found in `slides` directory. The slides do not have animations in order to make sure the files are of reasonable size and accessible by everybody. If you want the full presentation in Keynote format, please let Marijan Beg know. The slides are going to be extended as we progress through other sessions.

2. Tutorials and exercises as Jupyter notebooks are available in `tutorials` directory. More will be added as we go through the workshop. They are also accessible via Binder.

3. The materials addressing (too) specific questions we did not have time to discuss during live sessions, are going to be available in `extras` directory.

This is a public repository and it can be seen by everybody. If you want to contribute to it, please be careful what data you share.

## Current workshop

The current workshop is divided into 4 sessions:

1. Friday 24 April 2020, 14:00-15:30 (UK time) - The basics of micromagnetics, Jupyter, and Python
2. Wednesday 29 April 2020, 14:00-15:30 (UK time) - Micromagnetics with Ubermag
3. Monday 4 May 2020, 14:00-15:30 (UK time) - Data analysis and visualisation with Ubermag 1
4. Thursday 14 May 2020, 14:00-15:30 (UK time) - Data analysis and visualisation with Ubermag 2

Optional follow-up sessions, depending on the requests and feedback might be organised in the future.

## What to do before the workshop?

1. The workshop will delivered using [Zoom](https://zoom.us). Please install it before the workshop and join the session using this link: https://us04web.zoom.us/j/74465485256. There is no need to create an account with Zoom.

2. To follow the tutorials and exercises, you do not need to install anything on your machine or download (clone) this repository. The tutorials and exercises can be run in the cloud and no files will be created on your machine. Ubermag in the cloud can be accessed using Binder badge in the table above. Starting the cloud service can take a few minutes, so please be patient.

WARNING: The most recent update of Safari browser on MacOS sometimes does not interpret the colours well in 3D interactive plots and we recommend using Google Chrome for Ubermag.

## Support

If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in [ubermag/help](https://github.com/ubermag/help) repository.

## License

Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the [LICENSE](LICENSE) file.

## How to cite

If you use Ubermag, please cite it as:

1. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. [*AIP Advances* **7**, 56025 (2017)](http://aip.scitation.org/doi/10.1063/1.4977225).

2. M. Beg, R. A. Pepper, T. Kluyver, and H. Fangohr. ubermag/oommfc: Python interface to OOMMF integrated into Jupyter notebook. Zenodo. DOI: [10.5281/zenodo.3539494](http://doi.org/10.5281/zenodo.3539494) (2020).

## Acknowledgements

Developed as a part of:

- [OpenDreamKit](http://opendreamkit.org/) – Horizon 2020 European Research Infrastructure project (676541)

- EPSRC Programme grant on [Skyrmionics](http://www.skyrmions.ac.uk) (EP/N032128/1).
8 changes: 8 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: binder-environment

channels:
- conda-forge

dependencies:
- python==3.8
- oommfc==0.8.20
2 changes: 2 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install k3d
12 changes: 12 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubermag/oommf

USER root

RUN apt update -y
RUN apt install -y git python3-pip curl
RUN python3 -m pip install --upgrade pip pytest-cov nbval pycodestyle oommfc

COPY . /usr/local/workshop/
RUN chown -R oommfuser /usr/local/workshop/ # Make sure it is owned by the user.
USER oommfuser
WORKDIR /usr/local/workshop
18 changes: 18 additions & 0 deletions extras/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Extras

Here we collect the extra resources addressing questions we did not have time to discuss during live sessions.

## Where does the damping term in LLG equation come from?

1. Landau, L. & Lifshits, E. On the theory of the dispersion of magnetic permeability in ferromagnetic bodies. Phys. Zeitsch. Der Sow., 8, 153–169 (1935). https://doi.org/10.1016/B978-0-08-036364-6.50008-9

2. Gilbert, T. L. A phenomenological theory of damping in ferromagnetic materials. IEEE Transactions on Magnetics, 40(6), 3443–3449 (2014). https://doi.org/10.1109/TMAG.2004.836740

## How to do calculations with complex numbers in Python?

The Python library is `cmath`. Please refer to Python documentation: https://docs.python.org/3.8/library/cmath.html

## Further resources

- Python: https://docs.python.org/3/
- Jupyter: https://jupyter.org/documentation
Binary file added extras/derivations.pdf
Binary file not shown.
Binary file added slides/slides.pdf
Binary file not shown.
Loading

0 comments on commit 8b004a6

Please sign in to comment.