Skip to content

Instantly share code, notes, and snippets.

View smutch's full-sized avatar

Simon Mutch smutch

View GitHub Profile
@smutch
smutch / ads
Last active May 18, 2016 02:44
py: ADS tools
#!/usr/bin/env python3
"""ADS tools."""
from requests import post
from pathlib import Path
import subprocess
import click
import webbrowser
from urllib.parse import quote as url_quote
@smutch
smutch / groupby_cis.py
Created May 17, 2016 06:28
py: pandas grouping and aggregating to plot relations with confidence intervals (CIs)
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from dragons import meraxes
import pandas as pd
__author__ = "Simon Mutch"
__date__ = "2016-05-17"
@smutch
smutch / diff_with_version.sh
Last active May 24, 2016 02:01
sh: diff latex with previous version
#!/usr/bin/env bash
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
@smutch
smutch / PCA.ipynb
Created June 6, 2016 00:13
ipynb: PCA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smutch
smutch / chiara_send.ipynb
Created June 9, 2016 04:38
ipynb: PCA analysis Tonini 2016b galaxies
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smutch
smutch / CMakeLists.txt
Last active September 12, 2017 07:25
c: iterate hdf5 datasets
cmake_minimum_required(VERSION 3.0)
project(hdf5_check_ds)
# output paths
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
find_package(HDF5 REQUIRED COMPONENTS C HL)
include_directories(${HDF5_INCLUDE_DIRS})
@smutch
smutch / bayesopt_test_2d.ipynb
Created November 21, 2017 06:23
py: Scikit-optimize issue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smutch
smutch / Makefile
Created February 5, 2018 06:35
make: Simple makefile to run a standard cmake build
.PHONY: default config cleanbuild
default: build/Makefile
@make -C build --no-print-directory $(MFLAGS)
config:
@cmake . -Bbuild $(CMAKE_OPTS)
cleanbuild:
@rm -r build
@smutch
smutch / hdf5_compression.c
Created March 18, 2018 23:10
c:hdf5 compression test code
#include <stdio.h>
#include <hdf5.h>
#include <stdlib.h>
#include <hdf5_hl.h>
#include <math.h>
int main() {
uint dim = 512;
uint n_cell = (uint)pow(512, 3);
double fill_frac = 0.6;
@smutch
smutch / meraxes-ozstar_notes.md
Last active June 4, 2018 07:57
Meraxes on OzStar configuration notes

With updates to the modules on OzStar, we have to be careful with the modules setup and the flags we pass to Meraxes...

First off - make a copy of you module list so you can return to it if things go wrong:

module -t list >& $HOME/old_modules.txt

then purge your modules and set the purged state to be your default: