Open rht opened 5 years ago
@x0range @jsabuco I tested locally start.py works fine. I have since moved all the agent definition files to agents/, all contracts to contracts/, which unclutters the root dir.
Furthermore, maybe compute_profits_losses_from_cash.py, all the obsolete plotting code, visualization should be moved to a folder called analysis/. Without the folder organization, I have to deduce whether a file is an agent specification, a contract, a data analysis script, etc from scratch.
I am not opposed to create folders to organize the code.
Which is your view on this Torsten?
On Wed, 5 Dec 2018 at 01:53, rht notifications@github.com wrote:
Untested yet (pending Travis CI). Once tested I will move the rest of the agents to agents/ as well.
You can view, comment on, or merge this pull request online at:
https://github.com/INET-Complexity/isle/pull/108 Commit Summary
- [REFACTOR] Move metainsuranceorg.py to a folder agents/
File Changes
- R agents/metainsuranceorg.py https://github.com/INET-Complexity/isle/pull/108/files#diff-0 (0)
- M catbond.py https://github.com/INET-Complexity/isle/pull/108/files#diff-1 (2)
- M insurancefirm.py https://github.com/INET-Complexity/isle/pull/108/files#diff-2 (2)
- M reinsurancefirm.py https://github.com/INET-Complexity/isle/pull/108/files#diff-3 (2)
Patch Links:
- https://github.com/INET-Complexity/isle/pull/108.patch
- https://github.com/INET-Complexity/isle/pull/108.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/INET-Complexity/isle/pull/108, or mute the thread https://github.com/notifications/unsubscribe-auth/AKBvlEdQ5_IH5chrnRxqwENX5M45QNtgks5u1ycSgaJpZM4ZB2nQ .
Another concern here is that for the moment we cannot run models with subdirectories in the cloud that we are using. It will probably change soon. I will wait until then before merging this pull request.
Thank you very much for the suggestion!
Three comments on this:
Edit: I did not see that Juan had also just mentioned the sandman2 error connected to submodules.
OK, I see. What are the import errors caused by the submodules? They could be solved (not sure by which one) with either relative import, __init__
, or appending to sys.path
: sys.path.append(os.path.dirname(__file__))
.
While for other ABM projects it may make sense to have an agents submodule (comprising behavioral algorithms etc), I worry that in our case, agents are not sufficiently separate from the rest of the project (observe how the agent objects import stuff from all over the place).
The agents do import from contracts and riskmodel, even so, the import structure is not circular, and it should be fine to put the agents into one folder. The contracts are self-contained, on the other hand. The riskmodel, distributionreinsurance group are also self-contained.
I will investigate the quirks of sandman2 in the meantime.
(I rebased to remove the merge conflict in the meantime)
I added __init__.py
to contracts, and tested that start.py runs regardless of the current directory of the shell. I didn't expose metainsurancecontract in the __init__.py
though.
Rebased.
Untested yet (pending Travis CI). Once tested I will move the rest of the agents to agents/ as well.