Skip to content

Instantly share code, notes, and snippets.

View FlynnOConnell's full-sized avatar
🎯
Focusing

Flynn FlynnOConnell

🎯
Focusing
View GitHub Profile
@FlynnOConnell
FlynnOConnell / DataHandler.py
Created December 17, 2022 22:02
Data handler for neural network.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# datahandler.py
Module (nn_utils): Class to handle data for import into SVM classifier.
"""
import numpy as np
class DataHandler:
@FlynnOConnell
FlynnOConnell / Functions.py
Last active December 13, 2022 03:35
Custom functions, a variety of utility helpers.
# -*- coding: utf-8 -*-
"""
#funcs.py
Module(util): General getter/setter/checker functions.
"""
from __future__ import annotations
import os
import logging
from pathlib import Path
@FlynnOConnell
FlynnOConnell / FileHandler.py
Last active December 17, 2022 21:38
Class for file handling and directory management.
"""
#file_helpers.py
Module(utils/file_helpers): File handling data-container class to keep all file-related
data.
"""
from __future__ import annotations
import logging
from collections import namedtuple
from pathlib import Path
@FlynnOConnell
FlynnOConnell / Container.py
Last active December 17, 2022 21:38
Main data holding container.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#data.py
Module: Classes for data processing.
"""
from __future__ import annotations
import logging
from dataclasses import dataclass, field, InitVar
@FlynnOConnell
FlynnOConnell / __init__.py
Last active December 17, 2022 21:38
Initialization and Dependencies
"""
A package for analysis, statistics and visualization of Calcium Imaging data,
specifically from including from Inscopix.
"""
from __future__ import annotations
import os
from inspect import getsourcefile
import yaml
@FlynnOConnell
FlynnOConnell / Logic.cpp
Last active December 17, 2022 21:48
Main Queue Server Logic
void PremierSuite::queue(ServerWrapper server, void* params, std::string eventName) {
float totalQueueDelayTime = 0;
float autoGGDelayTime = cvarManager->getCvar("ranked_autogg_delay").getFloatValue() / 1000;
bool autoGG = cvarManager->getCvar("ranked_autogg").getBoolValue();
float queueDelayTime = cvarManager->getCvar(qDelayCvarName).getFloatValue();
bool disableCasualQueue = cvarManager->getCvar(disableCasualQCvarName).getBoolValue();
bool disablePrivate = cvarManager->getCvar(disablePrivateCvarName).getBoolValue();
if (autoGG) {
totalQueueDelayTime = queueDelayTime + autoGGDelayTime;
@FlynnOConnell
FlynnOConnell / getWorkshopMaps.cpp
Last active December 17, 2022 21:39
Gets workshop maps from the given directory.
/// <summary>Gets workshop maps from the given directory.</summary>
/// <param name="workshopPath">Path to the workshop directory to get the maps from</param>
/// <param name="extensions">List of map extensions to filter by</param>
/// <param name="preferredExtension">Map extension to prefer when multiple files are found</param>
/// <returns>The workshop maps from the given directory</returns>
std::vector<std::filesystem::path> PremierSuite::getWorkshopMaps(const std::filesystem::path& workshopPath,
const std::vector<std::string>& extensions,
const std::string& preferredExtension) {
if (!exists(workshopPath)) {
return std::vector<std::filesystem::path>();
@FlynnOConnell
FlynnOConnell / IterDirectory.cpp
Last active December 17, 2022 21:51
Recursively gets files from a certain directory.
/// <summary>Recursively gets files from a certain directory.</summary>
/// <remarks>These files can be filtered by if they end with certain file extensions.</remarks>
/// <param name="directory">Path to the directory to get the files from</param>
/// <param name="extensions">List of file extensions to filter by</param>
/// <param name="depth">Current folder depth</param>
/// <param name="maxDepth">Max folder depth to iterate through</param>
/// <returns>The files from a certain directory</returns>
std::vector<std::filesystem::path> PremierSuite::IterateDirectory(const std::filesystem::path& directory,
const std::vector<std::string>& extensions,
const int depth, const int maxDepth) {
@FlynnOConnell
FlynnOConnell / Gui.cpp
Last active December 18, 2022 05:52
PS_GUI
#include "pch.h"
#include "PremierSuite.h"
#include "IMGUI/imgui.h"
#include "IMGUI/imgui_internal.h"
#define IM_COL32_ERROR_RED (ImColor)IM_COL32(204,0,0,255)
/*
* Defining Functions
*/
@FlynnOConnell
FlynnOConnell / PremierSuite.cpp
Last active December 17, 2022 21:51
PS Initial Code Block
#include "pch.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <filesystem>
#include "PremierSuite.h"
BAKKESMOD_PLUGIN(PremierSuite, "Instant Suite", plugin_version, PLUGINTYPE_FREEPLAY | PLUGINTYPE_CUSTOM_TRAINING)
std::filesystem::path BakkesModConfigFolder;