-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug fixes, compartmentalisation and documentation for priority predecessor and zones criteria #634
base: mcda-restructure
Are you sure you want to change the base?
Conversation
6bbeb21
to
d9a4cba
Compare
48553f6
to
0470f52
Compare
Could you give an overview of what bugs were fixed? |
Sure, it's briefly summarized in #633, but I'll describe it more here. In the Matlab version the ADRIA.jl/src/ecosystem/connectivity.jl Line 190 in 5f7db89
When Julia: ADRIA.jl/src/decision/dMCDA.jl Lines 597 to 599 in 5f7db89
This means L599 above in the Julia version is using This difference informed assumptions in how the zone criteria are calculated also, so this PR includes changes to the zone criteria. |
Ah okay, sorry I somehow missed the linked issue. But the additional info is nice. |
0470f52
to
87767c0
Compare
Please format all files to conform to the style guide |
2246d40
to
d1e96de
Compare
I just formatted, so should be good to go |
d18662a
to
8a68c7a
Compare
src/analysis/scenario.jl
Outdated
rcps::Vector{Symbol} = Symbol.(:RCP, Int64.(scenarios[:, :RCP])) | ||
return Dict(rcp => rcps .== rcp for rcp in unique(rcps)) | ||
end | ||
|
||
function scenario_types(scenarios::DataFrame)::Dict{Symbol,BitVector} | ||
function scenario_types(scenarios::DataFrame)::Dict{Symbol, BitVector} |
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 standardise this formatting rule as well please?
Dict{Symbol, BitVector}
should have no space between the types.
src/decision/dMCDA.jl
Outdated
@@ -333,7 +336,8 @@ Columns indicate: | |||
- `wave_stress` : Probability of wave damage. | |||
- `heat_stress` : Probability of site being affected by heat stress | |||
- `predec` : List of priority predecessors (sites strongly connected to priority sites). | |||
- `risk_tol` : Tolerance for wave and heat risk (∈ [0,1]). Sites with heat or wave risk> risk_tol are filtered out. | |||
- `risk_tol` : Tolerance for wave and heat risk (∈ [0,1]). Sites with heat or wave | |||
risk> risk_tol are filtered out. |
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.
Typo
risk> risk_tol are filtered out. | |
risk > risk_tol are filtered out. |
@@ -187,7 +188,7 @@ function connectivity_strength(TP_base::AbstractMatrix{Float64})::NamedTuple | |||
C2 = outdegree_centrality(g) | |||
|
|||
# For each node, find strongly connected predecessor (by number of connections) | |||
strong_pred = zeros(Int64, size(C1)...) | |||
strong_pred = zeros(Int64, (size(C1)...)) |
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.
Did you add the parenthesis in or was this the formatter?
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 think this would work without the splat or parenthesis
strong_pred = zeros(Int64, (size(C1)...)) | |
strong_pred = zeros(Int64, size(C1)) |
3e2f8c3
to
8fd18dc
Compare
Hi Rose, could I get an update on this? I still see style issues but perhaps you've addressed these and have not yet pushed the changes? |
Hi Takuya, I recently pushed formatting changes but I just copied from the formatting setup guide you and Dan just added because I've noticed some things are a bit different. I'm just about to go and reformat all my PRs |
8313957
to
61367b7
Compare
Hi Rose, could you rebase this onto main please? |
098c952
to
7829620
Compare
In priority sites we use |
No no, I missed that it wasn't using |
Yeah it's a bit confusing because It also fixes a bug which was occuring because |
…er exists, to be updated shortly in another PR)
Remove `factors` input from `rsa()` and use scenario dataframe column names instead
…ity locations functions `strong_pred` and `zones` must be the same size
Zones criteria was incorrectly indexing using `strong_pred` - should have been using sites in `strong_pred` which contain priority zone sites, not values of `strong_pred` at sites in priority zones
`strong_pred` should be a matrix, with site ids in the first column. Without this, calcs in priority predecessor and zones criteria are incorrect
…g in a zone matters
Simplify and fix how `strong_pred` is used in zoning criteria Add to docs
Remove unnecessary findall Remove unnecessary findall
…additive, not replacement)
…rces and zone members
…priority zone have the highest criteria value
…reation + some formatting
…n docs Fix formatting and style
Was checking column 6 which is priority predecessors, instead of 8 which is leftover space
7829620
to
dcc09c2
Compare
I'll be merging this into the changes for MCDA Rose |
Closes #633
Separates the priority locations and priority zones criteria into their own functions for ease of testing. Also add further documentation for these criteria in the function docs.
Adds a testset for these criteria constructor functions. Also adds updates for the mcda decision matrix construction tests which were previously not included in the test suite.