pythontutorial

A Python tutorial focusing on analysis of magnetic data and other aspects relevant to the Rinehart Group.

https://github.com/rinehartgroup/pythontutorial

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
    Organization rinehartgroup has institutional domain (rinehartgroup.ucsd.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A Python tutorial focusing on analysis of magnetic data and other aspects relevant to the Rinehart Group.

Basic Info
  • Host: GitHub
  • Owner: RinehartGroup
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 9.22 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created almost 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

DOI

PythonTutorial

A Python tutorial focusing on analysis of magnetic data and other aspects relevant to the Rinehart Group.

Setup

See First Time Setup for instructions on how to set up your development environment according to Rinehart group standards. The tutorials in this repository can be copied into your scratch repository made during the First Time Setup.

Alternatively you can fork this repository into your personal GitHub account and clone it from there. Use Python 3.10 to create your virtual environment and install required dependencies using

pip install ipykernel git+https://github.com/RinehartGroup/MagnetoPy.git@v0.1.0

Here are some detailed instructions for how to work with a forked version of this repository.

How to Use These Tutorials

The tutorials herein contain a mixture of background information, examples, and exercises. They assume some basic knowledge of Python. If you're new to Python you may want to practice some of the basics on CheckiO. Doing 2-3 of the modules there should be sufficient to get you started.

Similar to the exercises on CheckiO, the exercises in these tutorials ask for you to fill out a function definition given a function signature and return type. There are many ways to solve the same problem. Your work is ultimately checked using assert statements. assert statements raise an exception if the code following assert does not return True. For example, the following code will raise an exception:

```python def get_average(a: float, b: float) -> float: return a + b

assert get_average(1, 2) == 1.5

AssertionError

```

While the following code will not raise an exception:

```python def get_average(a: float, b: float) -> float: return (a + b) / 2

assert get_average(1, 2) == 1.5 ```

Completed tutorial notebooks can be found in tutorial_answers.

Tutorials

  1. Reading Files into DataFrames

Read in some data from a .dat file containing data from magnetization vs field (hysteresis) measurements and do some basic manipulation of the data using pandas.

  1. Parsing Data Into Standard Formats

Having read in some .dat files containing data from M vs. H or ZFCFC experiments, figure out how to handle different file structures that arise from different users or different measurement conditions, and make some general functions that leave you with dataframes that are easy to plot and do analysis on.

  1. Object Oriented Programming and Documentation

Use object oriented programming to organize the parsing code from previous tutorials into DatFile and Dataset classes. Document your code using docstrings.

Owner

  • Name: Rinehart Group at UCSD
  • Login: RinehartGroup
  • Kind: organization
  • Location: La Jolla, CA

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: PythonTutorial
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Philip
    family-names: Bunting
    orcid: 'https://orcid.org/0000-0002-6059-2680'
  - given-names: Jeffrey
    family-names: Rinehart
    orcid: 'https://orcid.org/0000-0002-5478-1995'
repository-code: 'https://github.com/RinehartGroup/PythonTutorial'
url: 'https://github.com/RinehartGroup/PythonTutorial'
abstract: >-
  A Python tutorial focusing on analysis of magnetic data
  and other aspects relevant to the Rinehart Group.
license: MIT
version: 1.0.0
doi: 10.5281/zenodo.8294041
date-released: '2023-08-28'

GitHub Events

Total
Last Year