-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print line feature #282
Merged
Merged
Print line feature #282
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Restrict number of significant digits to 7, larger numbers as exponents
This reverts commit 5fd912f.
Moved column alignment to own PR: #283 |
attesn
approved these changes
Apr 16, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enables more efficient and easy way of writing agent data to file. Good work.
Only thing that I was thinking if there is any good solution for writing column titles? On the other hand it is easy to write title row before looping over agents.
zptro
pushed a commit
that referenced
this pull request
May 12, 2021
* Fixed seed number for population draw Set population seed, which can be used to stabilize population draw between model runs. Using fixed number and same zone data will result same population distributions. Notice that opposite to random module, Numpy initializes seed number along with module import. Therefore not all seeds can be set at modelsystem. However, with Python 3.6. numpy.random.choice can be replaced with random.choices and there would be no need to set two seed numbers. * Add Zone class Copy of #267. Zone class stores information on area and municipality membership and zone index. * Agent accessibility calculation * Add accessibility for each agent after adding individual dummies (car user). Get car, sustainable modes and total accessibility separately. * Transform utils to money, same application as in #265. * Add separate print result method for model system. Print results without groupings, which are done in R scripts later. * Update test_person.py * Add Zone class * Zone class to consider multilevel areas in parameters New multiple area intervals from #265 seem to clash with Zone class. * Make attribute check more explicit Revert unintended change in syntax * Use zone_interval methods define zone area * Replace for loops with is_in method already available in utils.zone_interval * Remove repeated code * 'zones' variable created before loop, so use it in place of zone_data list * Update docstring for logit.py * Update docstring description and return values from 'calc_individual_mode_prob' * Remove debug print call * Print call added to test functionality, not meant to be permanent * Cost coefficient calculation to separate function * Same code used in two places in 'logit.py', so similar function created to base class * Use area_aggregation with zone areas * Loop over param.zone.area_aggregation so that area definition is unambiguous * Print line feature (#282) * Create print_line method * Align columns better with values padded up to 12 digits Restrict number of significant digits to 7, larger numbers as exponents * Revert "Align columns better with values padded up to 12 digits" This reverts commit 5fd912f. * Add print method for person object * Use print line method for agent data output * Add is_car_user to agent model output data * Write columns headers in model system * Add person id * Add person id to clarify structure of agent data * Add id for test person * Adjust printing of variables * Add missing type for income (currently printed as NA) * Variable age to age_group as used before * Set person id within class * Change person_id as class variable and increment when object is created * Coding style issues * Fix docstring * Remove extra whitespace * Remove redundant 'nr_tours' variable and use len(tours) * Use 'try / except' in place of 'if / then' (EAFP) * Move printed attributes to Person class * Move attributes to Person class * Use resultdata.print_line in model system * Utilize same class names for printing column names and getting the variables (only one list containing definitions) * Style issue: Condense if clause * Optimize logsum calculation for individuals * Remove car_access as it is not used in mal-effect-calculations * Get sustainable accessibility from purpose vector * Fix person attribute printing order * Dictionary keys not necessarily in same order as list * Style updates * Class variable with lowercase (not constant) * Calling str function Co-authored-by: Jens West <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Can be used for printing a descriptive row of text for each agent.
Also adds better formatting when printing dataframes.