Skip to content

Instantly share code, notes, and snippets.

View oesteban's full-sized avatar
🦄

Oscar Esteban oesteban

🦄
View GitHub Profile
@oesteban
oesteban / nose3.log
Created August 8, 2016 19:00
an API-created gist
This file has been truncated, but you can view the full file.
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
nose.plugins.cover: INFO: Coverage report will include only packages: ['nipype']
nose.selector: INFO: /root/src/nipype/nipype/interfaces/tests/use_resources is executable; skipped
/root/src/nipype/nipype/workflows/dmri/mrtrix/group_connectivity.py:15: UserWarning: cmp not installed
warnings.warn('cmp not installed')
Doctest: nipype.algorithms.mesh ... ok
Doctest: nipype.algorithms.metrics ... ok
Doctest: nipype.algorithms.metrics.ErrorMap ... ok
Doctest: nipype.algorithms.metrics.FuzzyOverlap ... ok
Doctest: nipype.algorithms.metrics.Overlap ... ok
@oesteban
oesteban / createjson.py
Last active August 8, 2016 19:12
an API-created gist
#!/opt/conda/bin/python
"""
Convert files to json objects uploadable to GitHub gists using:
curl -v -H "Authorization: token <insert token here>" -X POST https://api.github.com/gists --data @<filename.json>
"""
import sys
import json
@oesteban
oesteban / rep_script.py
Last active August 12, 2016 08:10
Fixes docstrings for unicode
#!/usr/bin/env python
import re
import sys
from builtins import open
squote_exp = re.compile(r"(?P<ms>u?'(?:[^'\n\r\\]|(?:'')|(?:\\x[0-9a-fA-F]+)|(?:\\.))*')",
re.UNICODE)
def add_upref(m):
ms = m.group('ms')
@oesteban
oesteban / warpinfo.rst
Created January 12, 2017 21:16 — forked from satra/warpinfo.rst
combining bbregister, fsl and ants to warp functional images
@oesteban
oesteban / mprofile_20170324074440.dat
Created March 24, 2017 17:18
memory_profile trace
This file has been truncated, but you can view the full file.
CMDLINE python mriqc data/ out/ participant --participant_label 50052 --mem_gb 64 --verbose-reports --n_procs 10 --ants-nthreads 68 -f --profile -m T1w
MEM 0.816406 1490359481.9571
MEM 27.171875 1490359485.5077
MEM 28.769531 1490359488.9861
MEM 40.691406 1490359492.4732
MEM 55.683594 1490359495.9580
MEM 67.445312 1490359499.4542
MEM 71.191406 1490359502.9444
MEM 80.781250 1490359506.4395
MEM 86.386719 1490359509.9397
@oesteban
oesteban / IEEEbib.bst
Created October 20, 2017 23:42
The BST file for IEEE conferences, sorting names
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IEEE.bst %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography Syle file for articles according to IEEE instructions
% [email protected] <22-JUN-93>
% modified from unsrt.bib. Contributions by Richard H. Roy
ENTRY
{ address
author
booktitle
chapter
@oesteban
oesteban / fix_slicetiming.py
Last active June 12, 2020 20:46
fixing slicetiming in all sidecar jsons
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from glob import glob
import numpy as np
import json
import datalad
files = glob('sub-*/func/*_bold.json')
@oesteban
oesteban / check_jobs.py
Last active December 18, 2017 19:32
Check for a job-array in SLURM
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import re
import datetime
import subprocess as sp
from textwrap import indent
def get_parser():
@oesteban
oesteban / output.txt
Created November 21, 2017 23:46
Crashing nipype with memory consumption
Top 1 lines
#1: traits/has_traits.py:3008: 1.3 KiB
if not meta_eval( getattr( trait, meta_name ) ):37 other: 14.1 KiB
Total allocated size: 15.3 KiB
Top 1 lines
#1: testnipype.py:50: 8388608.0 KiB
large_str = ' ' * (8 * 1024**3)94 other: 362.5 KiB
Total allocated size: 8388970.6 KiB
@oesteban
oesteban / mem_fingerprint.py
Last active November 28, 2017 06:07
Comparing python interfaces vs. Report Capable.
>>> from pympler import asizeof
... from nipype.interfaces.fsl import BET
... from niworkflows.interfaces.masks import BETRPT
... from nipype.pipeline import engine as pe
... from niworkflows.nipype.pipeline import engine as pe2
>>> bet_old = BET(in_file="/home/oesteban/Data/openfmri/ds000001/sub-01/anat/sub-01_T1w.nii.gz")
>>> bet_rpt = BETRPT(in_file="/home/oesteban/Data/openfmri/ds000001/sub-01/anat/sub-01_T1w.nii.gz", generate_report=True)
>>> asizeof.asizeof(bet_old)
3808