Spaces:
Running
Running
Commit ·
8d80795
1
Parent(s): eaa78ee
removed all saves
Browse files- Dockerfile +1 -18
- draft_mailscript.py +3 -3
Dockerfile
CHANGED
|
@@ -1,26 +1,9 @@
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
# Set up a new user named "user" with user ID 1000
|
| 5 |
-
RUN useradd -m -u 1000 user
|
| 6 |
-
|
| 7 |
-
# Switch to the "user" user
|
| 8 |
-
USER user
|
| 9 |
-
|
| 10 |
-
# Set home to the user's home directory
|
| 11 |
-
ENV HOME=/home/user \
|
| 12 |
-
PATH=/home/user/.local/bin:$PATH
|
| 13 |
-
|
| 14 |
FROM python:3.9
|
| 15 |
|
| 16 |
-
|
| 17 |
-
WORKDIR $HOME/code
|
| 18 |
-
|
| 19 |
-
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
| 20 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 21 |
-
|
| 22 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 23 |
-
COPY --chown=user . $HOME/code
|
| 24 |
|
| 25 |
COPY ./requirements.txt /code/requirements.txt
|
| 26 |
|
|
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
+
WORKDIR /code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
draft_mailscript.py
CHANGED
|
@@ -91,7 +91,7 @@ def bookingcomparison_year2019(qmodel_df : pd.DataFrame()) -> str:
|
|
| 91 |
im = Image.open('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 92 |
width, height = im.size
|
| 93 |
im1 = im.crop((100, 100, 600, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 94 |
-
im1.save('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 95 |
|
| 96 |
# Gather observations ___________
|
| 97 |
observations_thisweekvsyear2019 = ["The overall bookings this week {isincreased} compared to 2019 by {percentincordec}%".format(isincreased = 'increased' if thisweekvsyear2019.percentchangefrom2019.sum() > 0 else 'decreased', percentincordec = round(abs(thisweekvsyear2019.percentchangefrom2019.mean()), 2))]
|
|
@@ -170,7 +170,7 @@ def bookingcomparison_previousweek(qmodel_df: pd.DataFrame()) -> str:
|
|
| 170 |
im = Image.open('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 171 |
width, height = im.size
|
| 172 |
im1 = im.crop((100, 100, 600, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 173 |
-
im1.save('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 174 |
|
| 175 |
# Gather observations ___________
|
| 176 |
observations_thisweekvslastweek = ["The overall bookings this week {isincreased} from the previous week by {percentincordec}%".format(isincreased = 'increased' if thisweekvslastweek.percentchangefromlastweek.sum() > 0 else 'decreased', percentincordec = round(thisweekvslastweek.percentchangefromlastweek.mean(), 2))]
|
|
@@ -245,7 +245,7 @@ def actualbookingstats(qmodel_df : pd.DataFrame()) -> str:
|
|
| 245 |
im = Image.open('/code/static/images/dailybooking_lineplot.png')
|
| 246 |
width, height = im.size
|
| 247 |
im1 = im.crop((50, 75, 570, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 248 |
-
im1.save('/code/static/images/dailybooking_lineplot.png')
|
| 249 |
bookingstats = []
|
| 250 |
bookingstats.append("The average number of booking per day is {perdaybooking2021} which is {percentdiff20n21:.1f}% {highorlow20n21} than 2020 {andorbut} {percentdiff21n19:.1f}% {highorlow21n19} than year 2019."\
|
| 251 |
.format(perdaybooking2021= format(int(dlatest21.ActualBooking.mean()), ','),
|
|
|
|
| 91 |
im = Image.open('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 92 |
width, height = im.size
|
| 93 |
im1 = im.crop((100, 100, 600, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 94 |
+
# im1.save('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 95 |
|
| 96 |
# Gather observations ___________
|
| 97 |
observations_thisweekvsyear2019 = ["The overall bookings this week {isincreased} compared to 2019 by {percentincordec}%".format(isincreased = 'increased' if thisweekvsyear2019.percentchangefrom2019.sum() > 0 else 'decreased', percentincordec = round(abs(thisweekvsyear2019.percentchangefrom2019.mean()), 2))]
|
|
|
|
| 170 |
im = Image.open('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 171 |
width, height = im.size
|
| 172 |
im1 = im.crop((100, 100, 600, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 173 |
+
#im1.save('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 174 |
|
| 175 |
# Gather observations ___________
|
| 176 |
observations_thisweekvslastweek = ["The overall bookings this week {isincreased} from the previous week by {percentincordec}%".format(isincreased = 'increased' if thisweekvslastweek.percentchangefromlastweek.sum() > 0 else 'decreased', percentincordec = round(thisweekvslastweek.percentchangefromlastweek.mean(), 2))]
|
|
|
|
| 245 |
im = Image.open('/code/static/images/dailybooking_lineplot.png')
|
| 246 |
width, height = im.size
|
| 247 |
im1 = im.crop((50, 75, 570, 390)) #set the crop coordinates (x,y, x+width, y+height)
|
| 248 |
+
#im1.save('/code/static/images/dailybooking_lineplot.png')
|
| 249 |
bookingstats = []
|
| 250 |
bookingstats.append("The average number of booking per day is {perdaybooking2021} which is {percentdiff20n21:.1f}% {highorlow20n21} than 2020 {andorbut} {percentdiff21n19:.1f}% {highorlow21n19} than year 2019."\
|
| 251 |
.format(perdaybooking2021= format(int(dlatest21.ActualBooking.mean()), ','),
|