Skip to content
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

Export and merge functions #17

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Commits on Feb 3, 2017

  1. Configuration menu
    Copy the full SHA
    2dbc7cf View commit details
    Browse the repository at this point in the history
  2. Split collections and item classes into separate files and out of bas…

    …e.py
    
    The new attribute system will involve meta classes other helper objects
    I prefer to keep separate from the objects that use them for neatness.
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    2014840 View commit details
    Browse the repository at this point in the history
  3. Changed Collection subclassing to use class attribute

    Rather than specify which data model the collection is a 'collection'
    of in an overridden __init__ - now subclasses override the
    object_class class attribute with the correct data model.
    
    Not hugely important, stylistic choice - prefer avoiding super calls.
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    16373b7 View commit details
    Browse the repository at this point in the history
  4. Collection objects are permanent parts of Popolo object

    Previously a MembershipCollection object would be
    generated on request on accessing the membership property.
    Now this is generated and assigned at creation.
    
    Reason: collections need to be permanent so that changes to
    their objects can be repackaged into a file.
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    b12f3c6 View commit details
    Browse the repository at this point in the history
  5. Amend PopoloObject to prepare for read/write data objects

    In new system, rather than the properties of a PopoloObject
    being defined as @property-ed functions accessing properties
    of self.data - this will be replaced by the 'Attribute' class
     - that given a attribute will control getting and setting
     to self.data.
    
    Subclasses of Attribute control different ways of talking to data
    e.g. talking to data that is a date.
    
    A small meta-class is used for PopoloObject to avoid repetition
    in definitions.
    e.g. person = Property(attr=person) can be expressed as
    person = Property()
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    c7f0caf View commit details
    Browse the repository at this point in the history
  6. PopoloObject subclasses moved to new attribute system

    Almost all previous @property-ed functions replaced with
    Attribute object.
    
    Functionality for 'getting' and default values are identical
    to old arrangement.
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    bc36884 View commit details
    Browse the repository at this point in the history
  7. Created 'twitter' setter for Person object.

    When a new 'twitter' value is set, if a url - the link value is
    set - and the username is also extracted for contact details.
    
    If not a url, just updates the contact details.
    ajparsons committed Feb 3, 2017
    Configuration menu
    Copy the full SHA
    2cbccd5 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2017

  1. Changed defaults for date properties to use .PAST or .FUTURE

    Date fields for Person and Organization were set to default to
    None rather than the vague .PAST and .FUTURE from approxdate.
    
    This has been changed to bring it into sync with other Membership
    and Event objects.
    
    Person Test updated to reflect this change.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    82a95a5 View commit details
    Browse the repository at this point in the history
  2. Added export functionality

    Popolo objects can now export to json (to_json) or
    direct to a file name.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    240d637 View commit details
    Browse the repository at this point in the history
  3. Added 'merge' function

    Two popolo objects can now be merged. Each collectiontype has
    a value that must be made 'unique' (either name or id).
    
    In a collision, the 'larger' will be kept (assumed more information)
    and all refs to discarded ids replaced.
    
    More complex functionality e.g. the bigger person object picking
    up all possible alternate names of the smaller one, can be
    specified by overriding the absorb function.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    72c2801 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d6c7d73 View commit details
    Browse the repository at this point in the history
  5. Date attributes will now accept datetime objects being 'set'

    Datetime objects will be reduced to just their date, then converted to isoformat
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    d5366c5 View commit details
    Browse the repository at this point in the history
  6. Add safeguards to prevent objects sharing attributes.

    Exposed json_data as something that can be accessed,
    but that is not independent of child objects.
    New objects are based on a deepcopy of the incoming dict.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    400691f View commit details
    Browse the repository at this point in the history
  7. Added test suite with tests for property setting and file saving.

    Updated person tests with test for __gt__ and __lt__
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    7b6166a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2520cfd View commit details
    Browse the repository at this point in the history
  9. Removed unused ability to specify which field is used to match Relate…

    …dAttributes
    
    Originally this was so you could build RelatedAttributes on something other than an ID field.
    This was never necessary, so removed to tidy up.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    461cedf View commit details
    Browse the repository at this point in the history
  10. Added processing for handling of saving vague-dates and date ranges.

    These features will also be useful in the approx_dates package directly,
    and will be ported there at some point.
    ajparsons committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    63a87e9 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    270f68a View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2018

  1. Created effective_start_date and effective_end_date properties

    Returns either unique time from membership or that from
    overall legislative period.
    ajparsons committed Jan 30, 2018
    Configuration menu
    Copy the full SHA
    04a8729 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2018

  1. Add get_identfier function

    Nicer way of getting a wikidata, parlparse, etc
    for an individual.
    ajparsons committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    c4a39a5 View commit details
    Browse the repository at this point in the history
  2. Updated hash id system for memberships

    Replaces with a cross-platform compatible hashing method
    so membership ids are generated consistently
    ajparsons committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    ba755f7 View commit details
    Browse the repository at this point in the history
  3. Fix to merge function

    Will absorb gender of 'other' when self has none.
    ajparsons committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    6df1ea7 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2020

  1. Configuration menu
    Copy the full SHA
    7db9f3c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ccbd20d View commit details
    Browse the repository at this point in the history