Tether is a JavaScript library for positioning UI elements relative to other elements, ensuring they remain attached during scroll, resize, and other interactions. It solves common UI positioning challenges for tooltips, dropdowns, popovers, and similar components through a modular architecture. The core Tether class utilizes plugins for constraint handling, abutment detection, and position shifting, built upon an evented base class for custom event management. The library demonstrates strong engineering practices with clear separation of concerns, comprehensive unit and integration tests (Jest and Cypress), and support for both UMD and ESM module formats. While the positioning logic inherently addresses complex browser edge cases, the codebase is well-structured and maintainable, evidenced by recent commits and a defined release process. Examples and documentation showcase real-world usage patterns. Two reusable components stand out: the evented utility (src/js/evented.js) implements a lightweight event emitter with on, once, off, and trigger methods, demonstrating the observer pattern for decoupled communication. The deferred utility (src/js/utils/deferred.js) provides a promise-like mechanism for asynchronous control flow with resolve, reject, and promise methods. Both modules are minimally coupled, depending only on a type-check utility, and embody proven patterns suitable for extraction into other projects.
This repository is a Python framework for constrained nonlinear optimization, with a strong emphasis on uncertainty quantification (UQ) and scientific machine learning. It provides a suite of derivative-free global and local optimizers (differential evolution, Nelder-Mead, Powell, etc.) through a common abstract interface, alongside powerful constraint and penalty handling via symbolic equations (using sympy) and decorator-based composition. The library supports ensemble solvers, parallel execution (via pathos/pyina), and includes extensive UQ tools: discrete measures, product measures, expectation bounds, probability of failure, and McDiarmid bounds. It is structured as a reusable Python package with well-documented modules and a large collection of example scripts demonstrating applications from benchmark optimization to XRD surrogate design and geophysical inversion. While the core library is solid and showcases high craftsmanship in its symbolic constraint generation and abstract solver pattern, many example scripts are exploratory and contain hardcoded parameters or incomplete code, reflecting its research origins. The framework is actively maintained but shows some technical drift (e.g., a forked legacy SciPy optimizer, use of eval/exec in logging and plotting, and heavy reliance on optional dependencies like sympy, klepto, and pathos).