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

Appstruct #436

Merged
merged 13 commits into from
Jul 26, 2024
Merged

Appstruct #436

merged 13 commits into from
Jul 26, 2024

Conversation

remicousin
Copy link
Contributor

Setting up what's needed to make app(s) in pepsico directory. First commit is a pure copy from enacts then 2nd commit adapts to the pepsico situation. Not sure if anything else is needed. Once that and the data are ready, we'll start working on a maproom.py and a layout.py for pepsico/projections.

(Eventually we'd want the common parts between enacts and pepsico to move one level up and be referenced by each, but I don't think we have time for that now -- or rather no time to test that it doesn't break anything in enacts).

@remicousin
Copy link
Contributor Author

I believe we need the docker piece only once we want that be built somewhere in Maproom, correct?

Copy link
Collaborator

@aaron-kaplan aaron-kaplan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok so far, but there's no way to test it until the maproom exists. I would lean towards waiting until you've tested it to merge, but there's no risk, so you can merge if you want.

A Dockerfile is needed in order to deploy the application to our servers.

pepsico/config-dev-sample.yaml Outdated Show resolved Hide resolved
pepsico/globals_.py Show resolved Hide resolved
@remicousin
Copy link
Contributor Author

Looks ok so far, but there's no way to test it until the maproom exists. I would lean towards waiting until you've tested it to merge, but there's no risk, so you can merge if you want.

Let me add maproom/layout.py without data involved. That we save Sheen some time as the Tutorial is a bit outdated with respect to how things are set up.

@remicousin
Copy link
Contributor Author

Note for later:
localhost:xxxx/python_maproom/
is ok but it links to
localhost:xxxx/python_maproom/projections
that is 404.

I also had to put the following in my local config file. Not sure why it seems to ignore it when in config-defaults. Same thing for maproom: config entries.

But need to double check on all that later.

datasets:
shapes_adm:
- name: National
color: black
sql: select adm0_code as key, adm0_name as label,
ST_AsBinary(ST_Simplify(ST_Union(the_geom), .01))
from g2015_2012_0
is_checked: True
- name: Adm2
color: black
sql: select (adm0_code, adm1_code) as key, adm1_name as label,
ST_AsBinary(ST_Simplify(ST_Union(the_geom), .01)) as the_geom
from g2015_2014_1
is_checked: False
- name: Adm2
color: grey
sql: select (adm0_code, adm1_code, adm2_code) as key, adm2_name as label,
ST_AsBinary(ST_Simplify(ST_Union(the_geom), .01)) as the_geom
from g2015_2014_2
is_checked: False

@remicousin
Copy link
Contributor Author

I am still poking a bit in the dark to figure out why the URL of the app points to 404. If it's evident to you, please unblock me otherwise I'll keep poking. It doesn't seem right that I have to define maprooms: in both config files for it to work as it is so maybe that's where some confusion lies. Maybe I don't have the right syntax here as it changed to allow multiple maprooms from same py files. I need to search what that syntax is.

Otherwise with enactsmaproom conda env:
CONFIG=config-dev-sample.yaml:myconfig.yaml python app.py

where myconfig just has your regular build env stuff and the db pswd

@remicousin
Copy link
Contributor Author

Looks like I made it through. I was the - thingy for multiple maprooms from one file

@remicousin
Copy link
Contributor Author

For the moment I saw the countries drawn but that's it, no data yet. It's very slow and it looks like storm took a toll with running it. Not sure yet if it's the shapes, or the data, or both.

@aaron-kaplan
Copy link
Collaborator

Storm doesn't have a huge amount of memory, and @sheenzutshi has a couple of very memory-intensive processes running on it. So (a) give it a try on shortfin01, and (b) if someone shows me Sheen's script maybe I can make a suggestion about how to reduce its memory usage.

@remicousin
Copy link
Contributor Author

Alright, this just plot the map of one variable/model/scenario at it's last time point. Initial load takes a little bit. Most likely due to the shapes as the data comes right after the map + shapes are eventually plotted. Since that parts is a one-time load open landing, that sounds fine. Interestingly enough... this reveals that our drawing of borders is not taken into consideration with respect to Earth periodicity along longitude, as dash-leaflest let's you zoom out or scroll West/East through "multiple Earths." Anyways... not very important at the moment.

This also reads the one variable I rechunked in time. Now I need to go to the Nigeria office to retrieve my passport. After that I can wrap up the rechunking of all the other data, and wrap up the seasonal calculation. And I can talk with Sheen about she is interested in trying to contribute to in the few days left, if she can at all. Independently, it seems that having a first version of this app before she leaves is attainable.

(And so I'll merge this when I come back since was already approve and unless there is new comments in the meantime)

@remicousin remicousin merged commit f02499a into master Jul 26, 2024
1 check passed
@remicousin remicousin deleted the appstruct branch July 26, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants