___________ ____
________ __ ___/ / ____/ | / __ \
/ ___/ __` / __ / / / /| | / / / /
/ /__/ /_/ / /_/ / /___/ ___ |/ /_/ /
\___/\__,_/\__,_/\____/_/ |_/_____/
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.
Previous Stable Release (No Longer Supported)
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
$
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
Follow this document to start contributing!
This PR does the following:
funcy
, which was creating an imcompatibility with Python>=3.10
requirements.txt
in order to future-proof itBumps wheel from 0.36.2 to 0.38.1.
Sourced from wheel's changelog.
Release Notes
UNRELEASED
- Updated vendored
packaging
to 22.00.38.4 (2022-11-09)
- Fixed
PKG-INFO
conversion inbdist_wheel
mangling UTF-8 header values inMETADATA
(PR by Anderson Bravalheri)0.38.3 (2022-11-08)
- Fixed install failure when used with
--no-binary
, reported on Ubuntu 20.04, by removingsetup_requires
fromsetup.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
withsetuptools
- The handling of
license_files
(including glob patterns and default values) is now delegated tosetuptools>=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 usingSOURCE_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 theWHEEL
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)
6f1608d
Created a new releasecf8f5ef
Moved news item from PR #484 to its proper place9ec2016
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 finala04dfef
Updated the pypi-publish action94bb62c
Fixed docs not building due to code style changesd635664
Updated the codecov action to the latest versionfcb94cd
Updated version to match the releaseDependabot 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
.
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 "
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. ```
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.
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.
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,
}
}
]
Design Framework for Generalized Dynamical Systems with a focus on Computer Aided Design and Digital Twins for Systems Incorporating Algorithmic Policy
GitHub Repository Homepage