-
Notifications
You must be signed in to change notification settings - Fork 95
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
Redo cross-referencing #362
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
org.nlogo.models.crossReference.singleModels: [ | ||
{ source: "Sample Models/Biology/AIDS.nlogo", referenceIn: "Sample Models/Social Science" } | ||
{ source: "Sample Models/Biology/Simple Birth Rates.nlogo", referenceIn: "Sample Models/Social Science" } | ||
|
||
{ source: "Sample Models/Biology/Evolution/Altruism.nlogo", referenceIn: "Sample Models/Social Science" } | ||
{ source: "Sample Models/Biology/Evolution/Cooperation.nlogo", referenceIn: "Sample Models/Social Science" } | ||
|
||
{ source: "Sample Models/Biology/Evolution/Unverified/Divide The Cake.nlogo", | ||
referenceIn: "Sample Models/Social Science/Unverified" } | ||
|
||
{ source: "Sample Models/Biology/Evolution/Altruism.nlogo", referenceIn: "Curricular Models/EACH" } | ||
{ source: "Sample Models/Biology/Evolution/Cooperation.nlogo", referenceIn: "Curricular Models/EACH" } | ||
|
||
{ source: "Sample Models/Biology/Evolution/Unverified/Divide The Cake.nlogo", | ||
referenceIn: "Curricular Models/EACH/Unverified" } | ||
|
||
{ source: "Sample Models/Networks/Team Assembly.nlogo", referenceIn: "Sample Models/Social Science" } | ||
|
||
{ source: "Code Examples/Extensions Examples/vid/Video Camera Example.nlogo", referenceIn: "Code Examples/Extension Examples/bitmap" } | ||
|
||
// BEAGLE curricular models | ||
{ source: "Sample Models/Biology/Wolf Sheep Predation.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Genetic Drift/GenDrift T interact.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Bug Hunt Speeds.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Bug Hunt Camouflage.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "HubNet Activities/Unverified/Guppy Spots HubNet.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Daisyworld.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Mimicry.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Altruism.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "Sample Models/Biology/Evolution/Cooperation.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution" } | ||
{ source: "HubNet Activities/Bug Hunters Camouflage HubNet.nlogo", referenceIn: "Curricular Models/BEAGLE Evolution/HubNet Activities" } | ||
|
||
// copy BEAGLE HubNet models to hubnet activities | ||
{ source: "Curricular Models/BEAGLE Evolution/HubNet Activities/Bird Breeders HubNet.nlogo", referenceIn: "HubNet Activities" } | ||
{ source: "Curricular Models/BEAGLE Evolution/HubNet Activities/Bug Hunters Competition HubNet.nlogo", referenceIn: "HubNet Activities" } | ||
{ source: "Curricular Models/BEAGLE Evolution/HubNet Activities/Critter Designers HubNet.nlogo", referenceIn: "HubNet Activities" } | ||
{ source: "Curricular Models/BEAGLE Evolution/HubNet Activities/Fish Spotters HubNet.nlogo", referenceIn: "HubNet Activities" } | ||
|
||
// Oil Cartel HubNet to HubNet Activities | ||
{ source: "Sample Models/Social Science/Oil Cartel HubNet.nlogo", referenceIn: "HubNet Activities" } | ||
|
||
// IABM Textbook models duplicated in Sample Models and Code Examples | ||
{ source: "IABM Textbook/chapter 3/El Farol Extensions/El Farol.nlogo", referenceIn: "Sample Models/Social Science" } | ||
{ source: "IABM Textbook/chapter 3/DLA extensions/DLA Simple.nlogo", referenceIn: "Sample Models/Chemistry & Physics/Diffusion Limited Aggregation" } | ||
{ source: "IABM Textbook/chapter 8/Arduino Example.nlogo", referenceIn: "Code Examples/Extensions Examples/arduino" } | ||
] | ||
|
||
org.nlogo.models.crossReference.directories: [ | ||
{ sourceDir: "Sample Models/Mathematics/Probability/ProbLab", referenceIn: "Curricular Models/ProbLab", recursive: false } | ||
{ sourceDir: "Sample Models/Mathematics/Probability/ProbLab/Unverified", | ||
referenceIn: "Curricular Models/ProbLab", recursive: false } | ||
|
||
{ sourceDir: "Sample Models/Chemistry & Physics/GasLab", referenceIn: "Curricular Models/GasLab", recursive: true } | ||
{ sourceDir: "Sample Models/Chemistry & Physics/MaterialSim", referenceIn: "Curricular Models/MaterialSim", recursive: true } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.nlogo.models | ||
|
||
import java.io.File | ||
import java.nio.file.{ Files, Paths } | ||
|
||
import com.typesafe.config.{ Config, ConfigFactory } | ||
|
||
import org.scalatest.FunSuite | ||
|
||
import scala.collection.JavaConverters._ | ||
|
||
class CrossReferenceTests extends FunSuite { | ||
|
||
val crossReference = ConfigFactory.parseFile(new File("crossReference.conf")) | ||
|
||
test("all cross-referenced single models exist") { | ||
val modelRefs = crossReference.getConfigList("org.nlogo.models.crossReference.singleModels").asScala | ||
modelRefs.foreach { ref => | ||
val source = ref.getString("source") | ||
assert(Files.isRegularFile(Paths.get(source)), s"expected to find a nlogo file at $source, but couldn't find it!") | ||
} | ||
} | ||
|
||
test("all cross-referenced directories exist and are directories") { | ||
val directoryRefs = crossReference.getConfigList("org.nlogo.models.crossReference.directories").asScala | ||
directoryRefs.foreach { ref => | ||
val source = ref.getString("sourceDir") | ||
assert(Files.isDirectory(Paths.get(source)), s"expected find a directory at $source, but couldn't find it!") | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is producing an error. Should it be (capitalize "extensions"):
{ source: "IABM Textbook/chapter 3/DLA Extensions/DLA Simple.nlogo", referenceIn: "Sample Models/Chemistry & Physics/Diffusion Limited Aggregation" }
I assume that means this new method is case-sensitive while the old was not?
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.
Yes, this is case-sensitive. My tests should have caught this :/. I'll push up changes.
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.
Now updated.