-
Notifications
You must be signed in to change notification settings - Fork 23
Strange behavior and interaction in GamitSession and PyNetwork between clusters, tie_points, and backbone #116
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
Comments
@pdsmith90 you asked a couple of weeks ago if unit tests were hard to write... this might be a good first issue to get experience with them if you want some practice writing and setting them up. We need several tests, but the most simple unit test that we need from above is something that takes a list of stations and checks to see if there are any duplicate entries within that list. We'd likely end up integrating that unit test with other related unit tests in the same test file-- for example, a test that first combines tie stations and subnetworks, and then checks a.) if all the entries from each data structure are present, and b.) if any of those entries are duplicates. To see how the tests are setup in general, have a look here at how my clustering tests are setup. The link above points to my Parallel.Gamit fork, since those unit tests and the automated framework to run them aren't in our master branch yet. Once @demiangomez merges #109 , any unit tests that you write will automatically run on any push you make to an open pull request into master (or any other branch), which saves you from having to setup the testing framework locally when you're just getting started with these. |
@espg : the behavior is to include ALL station in the stations array in the database (including ties). Method see Parallel.GAMIT/pgamit/pyNetwork.py Lines 338 to 340 in 25a8293
and Parallel.GAMIT/pgamit/pyGamitSession.py Lines 147 to 151 in 25a8293
Also, I checked with Eric and days 120-239 were run with |
That something in the code that's duplicating happens right here (from 90 onwards), in Parallel.GAMIT/pgamit/pyGamitSession.py Lines 79 to 100 in 25a8293
...and is documented as happening on the last quoted line here: Parallel.GAMIT/pgamit/pyGamitSession.py Lines 32 to 35 in 25a8293
@demiangomez the question is should the stations and station ties be merged into the Right now we have a situation where we:
If we decide to address this inside of
There are probably better options. We could, as a few possibilities, do some, all, or none of:
|
Line 90 onwards of
As I mentioned before, YES
The are other reasons why we need the ties identified, kml being one, but it is not the most important reason. The point here is that we need to make sure that the station set passed to Thanks |
This issue is closely tied this discussion, so please read the linked content before continuing.
Examining the data from this query:
SELECT * FROM public.gamit_subnets where "DOY"='180' and "Year"='2022'
Shows interesting behavior:
Which outputs the following (note the color highlight)
All of the red entries above are duplicates of stations already listed in the blue highlighting.
For
public.gamit_subnets
on DOY of 2022, there are 17 listed clusters in the data table, with the first cluster (labeled subnet 0) being the backbone network. That leaves 16 clusters, which correspond to the 16 clusters thatmake_clusters
produces. Since index zero in the postgres data table corresponds to the backbone, the indexing is off by 1; i.e.,df.iloc[1].stations
compares toa[0]
andb[0]
froma, b = make_clusters(points.T, stations)
, with "a" and "b" being theclusters
dictionary andcluster_ties
list respectively.This is the zero-th entry for cluster stations from the clusters dictionary-- note that it's identical to the blue highlighted text from
public.gamit_subnets
table for DOY 180 in 2022:Now, this is the output from the
cluster_ties
list, which is identical to the red highlighted text frompublic.gamit_subnets
table for DOY 180 in 2022:Looking at two additional entries from
public.gamit_subnets
and theclusters
dictionary &cluster_ties
list confirms the pattern.Questions
public.gamit_soln
2022 days 001-008?GamitSession
, we can fix the issue with the code from the previous bullet or similarstations
include the tie stations?GamitSession
wants these two data objects (tie points and station clusters) not to overlap.GamitSession
than what is setup inpyNetwork
The text was updated successfully, but these errors were encountered: