Skip to content

Instantly share code, notes, and snippets.

@jmcook1186
jmcook1186 / aggregate-arrays.txt
Last active February 9, 2024 13:51
aggregate-metrics-array
const tree = {
name: "Root",
children: [{
name: "A",
energy: [40, 40, 40],
carbon: [10, 10, 10],
children: [{
name: "C",
@jmcook1186
jmcook1186 / aggregate-draft.txt
Last active February 9, 2024 13:51
IF: draft aggregation function
/** This function does a depth-first, post-order traversal of the tree and aggregates the named metrics from each child into the parent node all the way up to the root*/
const tree = {
name: "Root",
carbon: 0,
energy: 0,
children: [{
name: "A",
energy: 40,
@jmcook1186
jmcook1186 / aggregation-test2.yml
Created January 24, 2024 11:56
manifest file for testing aggregation feature
name: nesting-demo
description: null
tags:
kind: web
complexity: moderate
category: on-premise
aggregation:
type: both
metrics:
- 'cpu-util'
// some input data with gaps in the record
const inputs = [{ timestamp: '2023-07-06T00:00', carbon: 10, energy: 30, duration: 10 },
{ timestamp: '2023-07-06T00:10', carbon: 10, energy: 30, duration: 10 },
{ timestamp: '2023-07-06T00:30', carbon: 10, energy: 30, duration: 5 },
{ timestamp: '2023-07-06T00:50', carbon: 10, energy: 30, duration: 20 }
]
const startTime = '2023-07-06T00:00'
const interval = 60
const endTime = '2023-07-06T10:00'
@jmcook1186
jmcook1186 / demo-ompl
Created November 8, 2023 11:02
demo ompl
name: if-demo
description: pipeline demo
initialize:
models:
- name: azure-importer
kind: builtin
- name: cloud-instance-metadata
kind: builtin
- name: intel
kind: shell
@jmcook1186
jmcook1186 / demo-impl
Created November 8, 2023 11:00
IF demo impl
name: if-demo
description: pipeline demo
initialize:
models:
- name: azure-importer
kind: builtin
- name: cloud-instance-metadata
kind: builtin
- name: intel
kind: shell
@jmcook1186
jmcook1186 / biosnicar-distributed.py
Created June 12, 2023 09:01
distributed runs of biosnicar using Dask delayed
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# save this alongside snicar-driver.py and run in the terminal using
# `python src/biosnicar/biosnicar-distributed.py`
import numpy as np
from pathlib import Path
import dask
@jmcook1186
jmcook1186 / biosnicar_iterator.py
Created June 2, 2023 08:41
Iterate over param values in biosnicar v2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# save this file to the top level biosnicar_py directory, then run from the command line
# as follows:
# python src/biosnicar/biosnicar_iterator.py
import numpy as np
from pathlib import Path
[Eth]
NetworkId = 12345
SyncMode = "snap"
EthDiscoveryURLs = []
SnapDiscoveryURLs = []
NoPruning = false
NoPrefetch = false
TxLookupLimit = 2350000
LightPeers = 100
UltraLightFraction = 75
@jmcook1186
jmcook1186 / attestation.txt
Created April 12, 2022 16:28
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 353
Hash: 0abcc1e4 a2cfa5c4 45caa7db 3b849bca
e35c3c82 fae8a7de bba76e66 65479de5
64a263d4 0b4cd09a bdcfa6fc 66c8799d
a415178f 3286c44b 74766a7a dcf71e7c