sc3 / cookcountyjail

A Django app that tracks the population of Cook County Jail over time and summarizes trends.
http://cookcountyjail.recoveredfactory.net/api/1.0/?format=json
Other
31 stars 23 forks source link

V2.0 Inmate Summary should display in_jail stats #280

Open nwinklareth opened 10 years ago

nwinklareth commented 10 years ago

Inmates in the Jail system can be incarcerated, meaning that they housed in a Cook County Jail building or they are not as they may be out on a bond or in an electronic monitoring program or in drug rehabilitation program. The HousingLocation Model has the in_jail field which indicates if the location is jail housing location if set to True or if set of False indicates that the inmate is not housed within the Jail System.

There are only so many locations within the jail, according to Wikipedia there are 12,700. There can be more in the system, but there should be no more than 12,700 in jail. To find out how many inmates are currently being housed just have to count all inmates whose housing location, in_jail, field is set to true.

Each day inmates are discharged, new ones booked and inmates change housing locations. These movements change the count of who is or is not being housed or in_jail. The summary information should show all of these changes as well as the gross counts.

nwinklareth commented 10 years ago

Proposed total population in_jail fields are:

nwinklareth commented 10 years ago

Proposed fields to track booked inmates who are put into jail:

nwinklareth commented 10 years ago

Proposed fields to track inmates who left who were housed in the jail:

nwinklareth commented 10 years ago

Proposed fields to track inmates who were transferred to in jail housing:

nwinklareth commented 10 years ago

Proposed fields to track inmates who are still in jail system and transferred out of in jail housing:

nwinklareth commented 10 years ago

To accurately track movement of inmates in and out of being housed by the Cook County Jail requires 65 new fields to be added. These fields are easy to populate, the question is adding this to the existing 50 or so fields too much?

Should these new fields be put into their own models? The way to connect them to the existing information is through the date field. Just fetch and then link them up and you have more detailed information. If this were to be done, perhaps the existing table should also be broken up, into smaller ones?

bepetersn commented 10 years ago

Hey Norbert,

This is definitely a great idea to track "in_jail". My initial inclination is that people outside jail are less interesting, and that we could simply bound the issue by saying how many are in_jail vs out_of_jail. That may not be clear.

I suppose it isn't true, necessarily, that the in_jail population is less interesting. But at the least, we might ignore accounting for transfers. If we maybe just keep track of both numbers, would that fulfill your goals for conveying all this information? On Mar 9, 2014 8:07 PM, "nwinklareth" notifications@github.com wrote:

Proposed fields to track inmates who are still in jail system and transferred out of in jail housing:

  • transferred_out_of_in_jail - total inmates who were transferred out of in jail, men and women
  • females_transferred_out_of_in_jail - total inmates who were transferred out of in jail, females
  • females_transferred_out_of_in_jail_as - total inmates who were transferred out of in jail, females Asian
  • females_transferred_out_of_in_jail_bk - total inmates who were transferred out of in jail, females Black
  • females_transferred_out_of_in_jail_in - total inmates who were transferred out of in jail, females Indian
  • females_transferred_out_of_in_jail_lt - total inmates who were transferred out of in jail, females Latino
  • females_transferred_out_of_in_jail_un - total inmates who were transferred out of in jail, females Unknown
  • females_transferred_out_of_in_jail_wh - total inmates who were transferred out of in jail, females White
  • males_transferred_out_of_in_jail - total inmates who were transferred out of in jail, male
  • males_transferred_out_of_in_jail_as - total inmates who were transferred out of in jail, males Asian
  • males_transferred_out_of_in_jail_bk - total inmates who were transferred out of in jail, males Black
  • males_transferred_out_of_in_jail_in - total inmates who were transferred out of in jail, males Indian
  • males_transferred_out_of_in_jail_lt - total inmates who were transferred out of in jail, males Latino
  • males_transferred_out_of_in_jail_un - total inmates who were transferred out of in jail, males Unknown
  • males_transferred_out_of_in_jail_wh - total inmates who were transferred out of in jail, males White

Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/280#issuecomment-37146489 .

nwinklareth commented 10 years ago

Yes we can just do the macro level tracking, however if someone wanted to know what accounted for the fluctuations they would not be able to answer that easily without the additional fields which is why I am asking for feedback.

On Sun, Mar 9, 2014 at 8:49 PM, Brian Everett Peterson < notifications@github.com> wrote:

Hey Norbert,

This is definitely a great idea to track "in_jail". My initial inclination is that people outside jail are less interesting, and that we could simply bound the issue by saying how many are in_jail vs out_of_jail. That may not be clear.

I suppose it isn't true, necessarily, that the in_jail population is less interesting. But at the least, we might ignore accounting for transfers. If we maybe just keep track of both numbers, would that fulfill your goals for conveying all this information? On Mar 9, 2014 8:07 PM, "nwinklareth" notifications@github.com wrote:

Proposed fields to track inmates who are still in jail system and transferred out of in jail housing:

  • transferred_out_of_in_jail - total inmates who were transferred out of in jail, men and women
  • females_transferred_out_of_in_jail - total inmates who were transferred out of in jail, females
  • females_transferred_out_of_in_jail_as - total inmates who were transferred out of in jail, females Asian
  • females_transferred_out_of_in_jail_bk - total inmates who were transferred out of in jail, females Black
  • females_transferred_out_of_in_jail_in - total inmates who were transferred out of in jail, females Indian
  • females_transferred_out_of_in_jail_lt - total inmates who were transferred out of in jail, females Latino
  • females_transferred_out_of_in_jail_un - total inmates who were transferred out of in jail, females Unknown
  • females_transferred_out_of_in_jail_wh - total inmates who were transferred out of in jail, females White
  • males_transferred_out_of_in_jail - total inmates who were transferred out of in jail, male
  • males_transferred_out_of_in_jail_as - total inmates who were transferred out of in jail, males Asian
  • males_transferred_out_of_in_jail_bk - total inmates who were transferred out of in jail, males Black
  • males_transferred_out_of_in_jail_in - total inmates who were transferred out of in jail, males Indian
  • males_transferred_out_of_in_jail_lt - total inmates who were transferred out of in jail, males Latino
  • males_transferred_out_of_in_jail_un - total inmates who were transferred out of in jail, males Unknown
  • males_transferred_out_of_in_jail_wh - total inmates who were transferred out of in jail, males White

Reply to this email directly or view it on GitHub< https://github.com/sc3/cookcountyjail/issues/280#issuecomment-37146489> .

Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/280#issuecomment-37147681 .

Regards

Norbert

Norbert Winklareth

randy7771026 commented 10 years ago

I suppose it is too much to ask and has likely already been addressed but is there a way to know when a person comes into the jail if they are transfered from house arrest, halfway houses, federal, state or out of state prison as opposed to arrest? Same thought again but when they leave the jail?

nwinklareth commented 10 years ago

Randy,

If we have access to the data sources that identify a person then we can track arrivals and departures. We know that that is possible for inmates who are convicted of state/local felonies as they are transferred to the state prison. We just need to start scraping the state penal site - a spring project perhaps. I have not heard of any data sources for halfway houses. House arrest is the electronic monitoring program and we are aware of those inmates.

Norbert

On Sun, Mar 9, 2014 at 9:24 PM, randy7771026 notifications@github.comwrote:

I suppose it is too much to ask and has likely already been addressed but is there a way to know when a person comes into the jail if they are transfered from house arrest, halfway houses, federal, state or out of state prison as opposed to arrest? Same thought again but when they leave the jail?

Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/280#issuecomment-37148691 .

Regards

Norbert

Norbert Winklareth

nwinklareth commented 10 years ago

In trying to implement this today I was stymied by how efficiently calculate in_jail status. I finally realized that given the restricted initial form calculating the what had changed incrementally required the following:

The other problem I was wrestling with was how to do the above repeatedly, when you have the situation that you are calculating this for a series of days. I think the way to do this efficiently is:

Then retrieve the in_jail stats from the day before the start day of series and then iterate over the collections by day following the summing logic laid out in the first paragraph.

Thoughts?

randy7771026 commented 10 years ago

Used to be a doubly linked list would allow for the searching so maybe you want to go back to a hierarchical thought process and algorithm until you get really used to the data and the human representation.

On Sat, Mar 29, 2014 at 8:39 PM, nwinklareth notifications@github.comwrote:

In trying to implement this today I was stymied by how efficiently calculate in_jail status. I finally realized that given the restricted initial form calculating the what had changed incrementally required the following:

  • list of discharged prisoners, their in_jail state is subtracted from the previous total
  • list of newly booked prisoners, their in_jail state is added to the previous total
  • list of prisoners who had changes to their housing location, the difference in_jail state status, essential 1 or -1, is added to the previous total.

The other problem I was wrestling with was how to do the above repeatedly, when you have the situation that you are calculating this for a series of days. I think the way to do this efficiently is:

  • select the set of HousingLocations that in_jail is false, there are just 66 of them and test if the current location is in this set
  • fetch and cache the housing history from the start day of the series to the current day and then when there is a need to get previous entry fetch it
  • fetch and cache discharged and booked inmates from the start day of the series to the current day

Then retrieve the in_jail stats from the day before the start day of series and then iterate over the collections by day following the summing logic laid out in the first paragraph.

Thoughts?

Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/280#issuecomment-39014928 .