This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All rights for ase belong to the owners at https://gitlab.com/ase/ase | |
# this is a partial rewrite of the original lammpsrun.py found at: | |
# https://gitlab.com/ase/ase/-/blob/master/ase/io/lammpsrun.py?ref_type=heads | |
# Modifcations made by Chris Davies. See ase merge request | |
# https://gitlab.com/ase/ase/-/merge_requests/3354 | |
import gzip | |
import struct | |
from os.path import splitext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1: Identify Binary and Rare Trials | |
bi_index <- which(curr_block$option_left == 2 | curr_block$option_right == 2) # Binary option trial indices | |
rare_index <- which(curr_block$is_rare == 1) # Rare outcome trial indices | |
# Step 2: Find Positions of Rare Outcomes within Binary Trials | |
idx_rare_in_bi <- match(rare_index, bi_index) # Positions of rare outcomes in binary trials | |
diff_rare_in_bi <- diff(idx_rare_in_bi) # Differences between consecutive rare outcomes | |
# Step 3: Identify Consecutive Rare Outcomes | |
if (any(diff_rare_in_bi == 1)) { # Check for consecutive rare outcomes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.patches import Polygon, FancyArrowPatch | |
from typing import List, Tuple, Optional | |
class Structure: | |
def __init__(self, name: str, composition: List[float], color: str = 'black', | |
show_label: bool = True, label_font_size: Optional[int] = None): | |
self.name = name | |
self.composition = composition |