-
Notifications
You must be signed in to change notification settings - Fork 18
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
Interface & Visualization #50
Conversation
So I was trying to follow along with the interface README. When I ran |
Added install dependencies section
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.
Can you comment where you're using generated files vs. ones that you created and/or modified. I think this would help reviewers.
Adding comments to files as to the intent of the file would help people understand what they're about. Especially for example, upload1.js and upload2.js.
Python documentation strings are missing in python code
app/Meta.py
Outdated
for pt in list(row['geometry'].exterior.coords): | ||
pt=pt+(115,) | ||
flat_list.append(pt) | ||
poly = Polygon(flat_list) | ||
data.loc[index, 'geometry'] = poly | ||
|
||
if(all(x in accepted_columns for x in columns)): | ||
data['notes']=data_g['notes'] | ||
#data['geometry']=data_g['geometry'] | ||
data['time_zone'].fillna("America/Phoenix", inplace = True) | ||
data['soilnotes'].fillna("some text", inplace = True) |
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.
I feel the term "some text" should be replaced with "No notes". I feel that this is clearer
app/Meta.py
Outdated
@@ -191,8 +181,7 @@ def insert_sites(fileName,shp_file,dbf_file,prj_file,shx_file): | |||
os.remove(shp_file_target) | |||
os.remove(dbf_file_target) | |||
os.remove(prj_file_target) | |||
os.remove(shx_file_target) | |||
os.remove(file_name) |
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.
os.remove(file_name)
should remain here so that it's cleaned up when a problem occurs. Checking if the file exists before trying to remove it would prevent a missing file exception from being raised
if os.path.exists(file_name):
os.remove(file_name)
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.
os.remove(file_name) should be there.Otherwise file contents will be appended with existing ones when that endpoint is called next time.
visualization/pg_joins.js
Outdated
} | ||
|
||
|
||
const getTable1=async (cultivars, sites_cultivars, sites) => { |
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.
Use a more descriptive name here instead of "getTable1". Perhaps insertCultivarSites?
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.
Thanks! for pointing out, will change it in a future commit.
visualization/pg_joins.js
Outdated
} | ||
} | ||
|
||
const getTable2=async (experiments, experiments_sites, sites) => { |
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.
Use a more descriptive name than "getTable2" here
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.
Thanks! for pointing out, will change it in a future commit.
visualization/pg_joins.js
Outdated
|
||
sites.pop(); | ||
sites.pop(); | ||
sites.push("some text") |
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.
Use "No notes" here as well
visualization/pg_joins.js
Outdated
await client.query(query2); | ||
|
||
sites.pop(); | ||
sites.push("some text") |
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.
Use "No notes" here and everywhere else soilnotes defaults to "some text"
Co-authored-by: Chris Schnaufer <[email protected]>
app/Meta.py
Outdated
for index, row in data_g.iterrows(): | ||
flat_list = [] | ||
for pt in list(row['geometry'].exterior.coords): | ||
pt=pt+(115,) |
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.
This line of code adds another dimension to the loaded point. This causes problems when the points already have a Z value when loaded from the shapefile (point has 3 dimensions); after this line the point will have 4 dimensions and cause a failure
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.
Another comment on this is that every point that doesn't have a Z value will be assigned an elevation of 115 meters. IMO it would be better to default to zero or some other value indicating that it's probably not correct (unless you're at sea level)
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.
- @im-prakher try
" "
instead of no notes? - @Chris-Schnaufer could you provide more explicit instructions or go ahead and implement your suggestions below for .shp file and time zone handling? It isn't clear how challenging this would be but I think especially the shapefile handling could become a rabbit hole for someone not as familiar w/ GIS as you.
visualization/pg_joins.js
Outdated
await client.query(query2); | ||
|
||
sites.pop(); | ||
sites.push("some text") |
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.
sites.push("some text") | |
sites.push("") |
visualization/pg_joins.js
Outdated
|
||
sites.pop(); | ||
sites.pop(); | ||
sites.push("some text") |
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.
sites.push("some text") | |
sites.push("") |
visualization/pg_joins.js
Outdated
|
||
sites.pop(); | ||
sites.pop(); | ||
sites.push("some text") |
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.
sites.push("some text") | |
sites.push("") |
visualization/pg_joins.js
Outdated
|
||
sites.pop(); | ||
sites.pop(); | ||
sites.push("some text") |
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.
sites.push("some text") | |
sites.push("") |
visualization/pg_joins.js
Outdated
site.pop() | ||
site.pop() | ||
site.pop() | ||
site.push("some text") |
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.
site.push("some text") | |
site.push("") |
visualization/pg_joins.js
Outdated
site.pop() | ||
site.pop() | ||
site.pop() | ||
site.push("some text") |
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.
site.push("some text") | |
site.push("") |
@dlebauer or @Chris-Schnaufer would you be able to confirm your review so that this PR can be merged? |
…into interface
Co-authored-by: Chris Schnaufer <[email protected]>
Co-authored-by: David LeBauer <[email protected]>
Co-authored-by: David LeBauer <[email protected]>
This PR is now complete in itself, please have a final review and then merge it. |
Due to a lot of lines of code in this PR, it might be challenging to review the work done in recent commits so to make this easier, I have opened issues(regarding the recent commits) that are implemented in this PR. |
|
||
Before running the project, run: | ||
|
||
### `yarn` |
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.
Use code blocks for indicating code, e.g.
yarn
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.
- link to code for installing yarn https://classic.yarnpkg.com/en/docs/install
- describe OS requirements
- tell user to
cd interface
No description provided.