This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Combining XDiag with Hutch++. | |
| Copyright (C) 2025 aferro (ORCID: 0000-0003-3830-3595) | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Exploring out-of-core QR decompositions via dask. | |
| conda create -n dask python=3.10 | |
| conda activate dask | |
| pip install numpy | |
| pip install h5py |
This file contains hidden or 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
| # -*- coding:utf-8 -*- | |
| """ | |
| Place this script on a directory and convert the .exr files it contains | |
| into np.float32 matrices | |
| """ | |
| import os | |
| import OpenEXR |
This file contains hidden or 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
| #!/usr/bin python | |
| # -*- coding:utf-8 -*- | |
| """ | |
| """ | |
| import os | |
| import h5py |
This file contains hidden or 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
| #!/usr/bin python | |
| # -*- coding:utf-8 -*- | |
| """ | |
| This module features convenient color logger (wrapping the built-in ``loging.`` | |
| class), plus some helper functionality. | |
| """ | |
This file contains hidden or 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
| ################################################################################ | |
| ### server.py | |
| ################################################################################ | |
| #!/usr/bin/env python | |
| # -*- coding:utf-8 -*- | |
| """ | |
| Dummy server, interacts with the client receiving, altering and returning |
This file contains hidden or 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 matplotlib.font_manager as plt_fm | |
| class PltFontManager: | |
| """ | |
| Sometimes matplotlib finds the system font paths, but setting them can | |
| still be challenging due to using the wrong name or matplotlib complaining | |
| about missing elements. | |
| This manager static class is intended to aid with that, by facilitating |
This file contains hidden or 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
| from collections import defaultdict | |
| import random | |
| class SubsetSampler(torch.utils.data.Sampler): | |
| """ | |
| Like ``torch.utils.data.SubsetRandomsampler``, but without the random, | |
| and with the possibility of balanced sampling. Samples a subset of the | |
| given dataset from a given list of indices, without replacement. | |
| Usage example:: |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*-coding:utf-8-*- | |
| """ | |
| This module contains 2 functions: | |
| * ``cose_recovery``: Implements the L1 compressed sensing program, allowing | |
| for L2 error tolerance in the constraint. | |
| * ``cose_recovery_mpp``: Parallelized version of ``cose_recovery`` that runs |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding:utf-8 -*- | |
| """ | |
| !!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
| The quantities computed in this gist are wrong. While a correction is | |
| pending, see the following discussion for more details. The TLDR is that | |
| they must be divided by batch_size^2, or use the alternative Cockpit |
NewerOlder