Skip to main content

A library for easy mapping of mathematical specifications.

Project description

Mathematical Specification Mapping Library (MSML)

For documentation and getting started with MSML, please refer to the site for MSML here.

What is the Mathematical Specification Mapping Library (MSML)?

MSML is a library for standardizing the creation of mathematical specifications as JSON objects as well as aiding in the automation of report and visualization creation from these standardized JSON.

It uses block diagram wirings and spaces to represent the actions in complex systems in line with current BlockScience research on Generalized Dynamical Systems. It also adds some enhancements to the primitive blocks to represent richer sets of behaviors.

One good example is the wiring report for hunt prey wiring in the predator prey example (although it is best viewed in Obsidian where all the linking will work).

Installing the library

To install the library, simply pip install by running "pip install math-spec-mapping". The pypi package can be found here.

Why MSML?

Writing mathematical specifications can be a difficult process, especially when variable names are changed or new mechanisms are introduced. MSML seeks to streamline the process with automations as well as enhance the abilities of static math specs to deliver deeper insights. Because it is automated, one can write specifications at different levels of details or for different purposes.

Stakeholder Communications

  • In organizations, senior people / non-developers don't always have as intimate a view of the underlying code as the primary developers in a system because of time constraints and not working as directly with the code as the primary developers
  • Often this means that there is a reliance on asking the primary developers for clarifications and relying on "front-end" kinds of stuff such as visualizations or outputs of the model as opposed to combing through the underlying code
  • MSML seeks to help bridge this gap by allowing for the Obsidian markdown vault that can showcase every component and its dependencies for easier consumption.... this reduces the barriers to entry on understanding the back-end/underlying model
  • Also through things such as code linking, MSML allows for those with code fluency to jump into underlying code if they need to without even opening up the actual project repository

What are some of the solutions offered?

  • Automation: Automate writing of a specification
  • Standardization: Ensure standardization across teams working to spec out a system
  • Flexibility: Allow for creating views on the fly and in multiple ways depending on what stakeholders find important
  • Trackability: Keep a repository of a JSON file to track changes to the spec with the same enhancements git provides for projects already

How does MSML work?

graph TD
A[JSON Object \n\n Each spec has a repo for tracking changes \n Must conform to the json specification \n Defines all aspects of the spec including blocks, spaces and actions] -->B[MSML Object \n\n JSON file is parsed, with validations and mappings along the way \n Can show different views on the fly]
    B --> C[Report Outputs & Obsidian Directory \n\n Automatically build reports for the full spec or subviews \n Example: all blocks with an effect on variable XYZ\n Also builds an entire Obsidian directory of all components as linked notes]
D[Python Function Implementations \n\n Optional enhancement to actually execute code\n Done for each referenced policy option, mechanism, etc. \n Just needs a function definition for each] --> B 
B --> E[Python Wirings & Simulations \n\n MSML can be used to run blocks \n Wirings automatically work to pass between domain/codomains \n Entire simulations can be built up as composed wirings]

MSML in the Engineering Lifecycle

The engineering lifecycle as defined and visualized in "Block by Block: Managing Complexity with Model-Based Systems Engineering" is depicted below.

Systems Engineering Diagram

MSML can aid in all five of these phases in different ways.

Ideation and Conceptualization

During ideation phases, users of MSML can leverage the markdown writing tool to begin organizing different thoughts into components. For example, if one were trying to model a system that has multiple currencies, i.e. USD and the Euro, those could be added in as MSML types as they are discovered. The markdown report writing supports wiki-links for use in Obsidian or a similar tool allowing users to iteratively catalog different components they find in their research and ideation.

Requirements and Design

When moving into requirements and design, MSML provides a suite of reports so that presentations to stakeholders can be insightful but tailored to the different audiences. Feedback can be iteratively incorporated into the spec with reports being re-run.

Implementation, Integration, and Testing

In its basic form, a spec from MSML can be used to guide implementations because blocks can be transformed into actual code/functions and spaces act as the parameterizations of those functions. There is also experimental work being done on meta-programming so that MSML could either template simulation models or even be used to hold and write code where applicable for things such as A/B testing.

Operations and Maintenance

Thanks to some of the more advanced features, MSML can be used as an aid for debugging and system validation. The functionality around seeing what parameters effect which blocks directly or downstream indirectly helps developers quickly identify root causes of issues. The linkages between mechanisms and what pieces of state they update allows for developers to quickly see all possible paths to variable changes there are in case something looks amiss.

Governance and Evolution

The ability to fork the repository of an MSML spec as well as the ability to use it for A/B testing with the policy options makes it well suited for iterating on model evolution.

Other Related Repositories

GDS-MSML-cadCAD Repository

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

math_spec_mapping-0.4.4.tar.gz (51.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

math_spec_mapping-0.4.4-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file math_spec_mapping-0.4.4.tar.gz.

File metadata

  • Download URL: math_spec_mapping-0.4.4.tar.gz
  • Upload date:
  • Size: 51.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for math_spec_mapping-0.4.4.tar.gz
Algorithm Hash digest
SHA256 2acaba6ff79d443335f74d8d3b79a0898536e44ea61f5f935e66b92e9363a185
MD5 f3d706eb10dbb443d0ab35ac49abbbe8
BLAKE2b-256 e008b2c395bb89920734721a5aac0424b5a5e0146a9fdb708e7f16847ae68aed

See more details on using hashes here.

File details

Details for the file math_spec_mapping-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for math_spec_mapping-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 413dde216104581b5d420bb89eb89292c1d3a9f7c764ee0b346e636887bf85d5
MD5 633ff715259881629ecedb352f50bea0
BLAKE2b-256 5cb1f94586abb75b16b61426f60a36ad7f9247afa74145d868c78ce57f938178

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page