Design, simulate, validate, and operate within complex systems

cadCAD-org, updated 🕥 2023-02-15 13:45:37

___________ ____ ________ __ ___/ / ____/ | / __ \ / ___/ __` / __ / / / /| | / / / / / /__/ /_/ / /_/ / /___/ ___ |/ /_/ / \___/\__,_/\__,_/\____/_/ |_/_____/ by cadCAD ver. 0.4.28 ====================================== Complex Adaptive Dynamics o i e m d s p e i u d g t n e r cadCAD is a Python package that assists in the processes of designing, testing and validating complex systems through simulation, with support for Monte Carlo methods, A/B testing and parameter sweeping.

Getting Started

Change Log: ver. 0.4.28

Previous Stable Release (No Longer Supported)

0. Pre-installation Virtual Environments with venv (Optional):

If you wish to create an easy to use virtual environment to install cadCAD within, please use python's built in venv package.

Create a virtual environment: bash $ python3 -m venv ~/cadcad

Activate an existing virtual environment: bash $ source ~/cadcad/bin/activate (cadcad) $

Deactivate virtual environment: bash (cadcad) $ deactivate $

1. Installation:

Requires >= Python 3.6.13

Option A: Install Using pip bash pip3 install cadCAD

Option B: Build From Source pip3 install -r requirements.txt python3 setup.py sdist bdist_wheel pip3 install dist/*.whl

2. Documentation:

3. Connect:

  • Website: https://www.cadcad.org
  • Discord: https://discord.gg/DX9uH8m4qY
  • Twitter: https://twitter.com/cadcad_org
  • Forum: https://community.cadcad.org
  • Github: https://github.com/cadCAD-org
  • Telegram: https://t.me/cadcad_org

4. Contribute to this repository:

Follow this document to start contributing!

Issues

fix cadCAD for py=3.10

opened on 2023-02-15 13:45:36 by danlessa

This PR does the following:

  • Remove all un-used dependencies on the repo, including funcy, which was creating an imcompatibility with Python>=3.10
  • Use the Larger Than operator rather than the Equal to operator on requirements.txt in order to future-proof it

build(deps): bump wheel from 0.36.2 to 0.38.1

opened on 2022-12-26 21:35:34 by dependabot[bot]

Bumps wheel from 0.36.2 to 0.38.1.

Changelog

Sourced from wheel's changelog.

Release Notes

UNRELEASED

  • Updated vendored packaging to 22.0

0.38.4 (2022-11-09)

  • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

0.38.3 (2022-11-08)

  • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

0.38.2 (2022-11-05)

  • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

0.38.1 (2022-11-04)

  • Removed install dependency on setuptools
  • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

0.38.0 (2022-10-21)

  • Dropped support for Python < 3.7
  • Updated vendored packaging to 21.3
  • Replaced all uses of distutils with setuptools
  • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
  • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
  • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

0.37.1 (2021-12-22)

  • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
  • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

0.37.0 (2021-08-09)

  • Added official Python 3.10 support
  • Updated vendored packaging library to v20.9

... (truncated)

Commits
  • 6f1608d Created a new release
  • cf8f5ef Moved news item from PR #484 to its proper place
  • 9ec2016 Removed install dependency on setuptools (#483)
  • 747e1f6 Fixed PyPy SOABI parsing (#484)
  • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
  • 7b9e8e1 Test on Python 3.11 final
  • a04dfef Updated the pypi-publish action
  • 94bb62c Fixed docs not building due to code style changes
  • d635664 Updated the codecov action to the latest version
  • fcb94cd Updated version to match the release
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cadCAD-org/cadCAD/network/alerts).

cadcad 0.4.28 fails to install with python 3.10.4.

opened on 2022-07-11 17:16:53 by LinuxIsCool

Trying to install cadcad with pip3 fails.

``` 🐍(cadcad-explorations) [email protected] ~/Workspace/LongtailFinancial🚀/cadcad-explorations [main]× 🏂 python3 --version 1 [10:15:21] Python 3.10.4 🐍(cadcad-explorations) [email protected] ~/Workspace/LongtailFinancial🚀/cadcad-explorations [main]× 🏂 pip3 install cadcad [10:15:24] Collecting cadcad Using cached cadCAD-0.4.28-py3-none-any.whl (60 kB) Collecting dill Using cached dill-0.3.5.1-py2.py3-none-any.whl (95 kB) Requirement already satisfied: pytz in /home/ygg/.virtualenvs/cadcad-explorations/lib/python3.10/site-packages (from cadcad) (2022.1) Requirement already satisfied: six in /home/ygg/.virtualenvs/cadcad-explorations/lib/python3.10/site-packages (from cadcad) (1.16.0) Collecting fn Using cached fn-0.4.3.tar.gz (38 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [12 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/setup.py", line 6, in import fn File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/init.py", line 1, in from .stream import Stream File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/stream.py", line 9, in from .iters import map, range File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/iters.py", line 2, in from collections import deque, Iterable ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/init.py) [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. ```

pass `params` as a dict into policy and state update functions

opened on 2022-01-21 15:14:05 by cavaunpeu

In my code, system parameters are passed (as params) into policy and state update functions as a list with a single dictionary item. For example, params might look like:

python [ { 'a': 1, 'b': 2, ... } ]

This feels unintuitive, and necessitates something like params, = params (shorthand for params = params[0]) at the top of each function.

Separately, this issue was discussed here.

This PR may fixes this issue for me, in EXEC_MODE.single_proc mode, version 0.4.28.

Before considering a merge, a discussion should be had about whether this is expected to work across the gamut of execution modes.

Unhelpful error message when mechanism does not have return signature

opened on 2021-07-28 18:07:37 by jds3d

In the case where a mechanism like:

def account_for_tax(params, step, sL, s, inputs): key = 'GRT' delegation_tokens_quantity = inputs['delegation_tokens_quantity'] delegation_tax_rate = params['delegation_tax_rate']

tax = delegation_tax_rate * delegation_tokens_quantity
value = s['GRT'] - tax
**return key, value**

does not have the bold part (return key, value), you get the following error message:

c:\Users\Josh\anaconda3\envs\py396\lib\site-packages\cadCAD\engine\simulation.py in state_update_pipeline(self, sweep_dict, simulation_list, configs, env_processes, time_step, run, additional_objs) 172 sub_step += 1 173 for [s_conf, p_conf] in configs: --> 174 states_list: List[Dict[str, Any]] = self.partial_state_update( 175 sweep_dict, sub_step, states_list, simulation_list, s_conf, p_conf, env_processes, time_step, run, 176 additional_objs c:\Users\Josh\anaconda3\envs\py396\lib\site-packages\cadCAD\engine\simulation.py in partial_state_update(self, sweep_dict, sub_step, sL, sH, state_funcs, policy_funcs, env_processes, time_step, run, additional_objs) 138 return destination 139 --> 140 last_in_copy: Dict[str, Any] = transfer_missing_fields(last_in_obj, dict(generate_record(state_funcs))) 141 last_in_copy: Dict[str, Any] = self.apply_env_proc(sweep_dict, env_processes, last_in_copy) 142 last_in_copy['substep'], last_in_copy['timestep'], last_in_copy['run'] = sub_step, time_step, run TypeError: cannot convert dictionary update sequence element #1 to a sequence

It would be more helpful to say which mechanism had the issue and what the issue was.

State Update Function PSUB key not checked

opened on 2021-03-26 06:10:31 by BenSchZA

In the following notebook, the variables dictionary keys are not checked to match against the state update function keys: https://github.com/cadCAD-org/snippets/blob/main/snippets/execution_time_decorator.ipynb

We'd expect the following code, where the key 'a' has a state update function for key 'b', to throw an error when executed by cadCAD, but no error is thrown.

python= psubs = [ { 'policies': {}, 'variables': { 'a': update_b, 'b': update_a, } } ]

Releases

0.4.28 2021-10-07 22:11:18

cadCAD: Complex Adaptive Dynamics Computer Aided Design

Design Framework for Generalized Dynamical Systems with a focus on Computer Aided Design and Digital Twins for Systems Incorporating Algorithmic Policy

GitHub Repository Homepage