Skip to content

Instantly share code, notes, and snippets.

View mattwthompson's full-sized avatar
💭
👋

Matt Thompson mattwthompson

💭
👋
  • Open Molecular Software Foundation
  • Iowa City, IA
  • 08:44 (UTC -05:00)
View GitHub Profile
@mattwthompson
mattwthompson / script.py
Created June 5, 2024 21:55
pydantic v2 + Pint
"""
Simple, self-contained example showing how to get Pydantic and Pint to play nicely together.
This uses Pydantic v2 (only).
This doesn't yet handle arrays or OpenMM objects, but should be tractable and is called out below.
No (explicit) effort is made to ensure floats or ints remain the same type and don't get ducked.
"""
from pint import UnitRegistry, Quantity
@mattwthompson
mattwthompson / log.txt
Created May 30, 2024 20:14
local wheel failures
$ git diff | cat && cibuildwheel 15:13:06 ☁ 1.10.0 ☂
diff --git a/basesetup.py b/basesetup.py
index a4535a9d..add89a4a 100644
--- a/basesetup.py
+++ b/basesetup.py
@@ -60,9 +60,7 @@ class CompilerDetection:
self.compiler_args_sse2 = []
self.compiler_args_sse3 = ["-mssse3"] if (self.sse3_enabled and not self.msvc) else []
self.compiler_args_neon = []
- self.compiler_args_warn = (
@mattwthompson
mattwthompson / log.txt
Created May 3, 2024 13:47
downstream users of openmmforcefields
$ micromamba repoquery whoneeds openmmforcefields -c conda-forge 8:45:32 ☁ temporarily-no-gaff ☂
Getting repodata from channels...
conda-forge/osx-arm64 9.5MB @ 12.1MB/s 0.8s
conda-forge/noarch 14.5MB @ 14.1MB/s 1.0s
Name Version Build Depends Channel Subdir
────────────────────────────────────────────────────────────────────────────────
asapdiscovery 0.3.1 py311h267d04e_1 conda-forge osx-arm64
asapdiscovery 0.3.1 py310hbe9552e_1 conda-forge osx-arm64
espaloma 0.3.1 pyhd8ed1ab_0 conda-forge noarch
@mattwthompson
mattwthompson / log.txt
Created April 26, 2024 18:32
micromamba repoquery whoneeds netcdf4 -c conda-forge > log.txt
Getting repodata from channels...
conda-forge/osx-arm64 Using cache
conda-forge/noarch Using cache
Name Version Build Depends Channel Subdir
────────────────────────────────────────────────────────────────────────────────────────────────
abipy 0.7.0 pyh9f0ad1d_1 conda-forge noarch
abipy 0.9.7 pyhd8ed1ab_0 conda-forge noarch
abipy 0.8.0 pyh9f0ad1d_0 conda-forge noarch
abipy 0.9.0 pyhd8ed1ab_0 conda-forge noarch
@mattwthompson
mattwthompson / temperature.py
Created March 28, 2024 18:00
Quick example using annotated types for Pint/Pydantic v2 compatibility
from openff.units import Quantity
from typing import Annotated
from pydantic import (
BeforeValidator,
AfterValidator,
BaseModel,
ValidationError,
PositiveFloat,
)
from functools import partial
@mattwthompson
mattwthompson / linux.txt
Last active November 14, 2023 18:52
bespokefit-299
+ _libgcc_mutex 0.1 conda_forge conda-forge/linux-64 Cached
+ _openmp_mutex 4.5 2_kmp_llvm conda-forge/linux-64 Cached
+ ambertools 23.3 py310h05519df_6 conda-forge/linux-64 94MB
+ amqp 5.2.0 pyhd8ed1ab_0 conda-forge/noarch 48kB
+ anyio 3.7.1 pyhd8ed1ab_0 conda-forge/noarch 97kB
+ argcomplete 3.1.6 pyhd8ed1ab_0 conda-forge/noarch 40kB
+ argon2-cffi 23.1.0 pyhd8ed1ab_0 conda-forge/noarch 19kB
+ argon2-cffi-bindings 21.2.0 py310h2372a71_4 conda-forge/linux-64 34kB
+ arpack
@mattwthompson
mattwthompson / gist:06211a98b5b51e369716fbf181377e8d
Created September 8, 2023 19:09
LAMMPS vs. OpenMM parameters
import glob
import numpy
import openmm
from openff.toolkit import ForceField, Molecule
sage = ForceField("openff-2.1.0.offxml")
def get_lammps_charges(interchange) -> list[float]:
interchange.to_lammps("tmp.lammps")
-------------------------------------------------------
Amber 22 SANDER 2022
-------------------------------------------------------
| Run on 06/13/2023 at 15:09:44
| Executable path: sander
| Working directory: /Users/mattthompson/software/openff-interchange
| Hostname: Unknown
@mattwthompson
mattwthompson / 620.ipynb
Last active June 6, 2023 17:38
issue 620
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.