Skip to content
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

Update to 3.6 and fix enum doc-string generation #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 0 additions & 169 deletions Manifest.toml

This file was deleted.

4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HELICS"
uuid = "81524022-8764-5038-b61c-08cb1f58760f"
authors = ["Dheepak Krishnamurthy <me@kdheepak.com>"]
version = "3.4.0"
version = "3.6.0"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand All @@ -13,7 +13,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
CEnum = "^0.2"
DocStringExtensions = "^0.8"
julia = "^1.3"
HELICS_jll = "^3.4.0"
HELICS_jll = "^3.6.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
10 changes: 5 additions & 5 deletions src/enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
final = String[]

for (name, value) in CEnum.name_value_pairs(enum_type)

n = String(name)
d = strip(string(Docs.doc(Base.Docs.Binding(HELICS, Symbol(n)))))
# macroexpanded @doc and dug into that. We shouldn't be doing this.
doc_string_svec = Docs.meta(HELICS)[Docs.Binding(HELICS, name)].docs[Union{}].text
d = join(doc_string_svec, "\n ")

Check warning on line 60 in src/enums.jl

View check run for this annotation

Codecov / codecov/patch

src/enums.jl#L59-L60

Added lines #L59 - L60 were not covered by tests
v = string(value)

push!(final, "- `$n`: $d ($v)")
push!(final, "- `$name`: $d ($v)")

Check warning on line 63 in src/enums.jl

View check run for this annotation

Codecov / codecov/patch

src/enums.jl#L63

Added line #L63 was not covered by tests

end
join(final, "\n")
Expand Down Expand Up @@ -505,4 +505,4 @@
**enumeration of sequencing modes for queries and commands fast is the default, meaning the query travels along priority channels and takes precedence of over existing messages; ordered means it follows normal priority patterns and will be ordered along with existing messages**
$(_enum_doc_string(HELICS.HelicsSequencingModes))
"""
HELICS.HelicsSequencingModes
HELICS.HelicsSequencingModes
8 changes: 4 additions & 4 deletions test/systemtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ end
h.helicsBrokerSetGlobal(brk, "testglobal", globalVal)
q = h.helicsCreateQuery("global", "testglobal")
res = h.helicsQueryBrokerExecute(q, brk)
@test res == "{\n \"name\" : \"testglobal\",\n \"value\" : \"this is a string constant that functions as a global\"\n}"
@test res == "{\n \"name\": \"testglobal\",\n \"value\": \"this is a string constant that functions as a global\"\n}"

h.helicsBrokerSetGlobal(brk, "testglobal2", globalVal2)
h.helicsQueryFree(q)
q = h.helicsCreateQuery("global", "testglobal2")
res = h.helicsQueryBrokerExecute(q, brk)
@test res == "{\n \"name\" : \"testglobal2\",\n \"value\" : \"this is a second string constant that functions as a global\"\n}"
@test res == "{\n \"name\": \"testglobal2\",\n \"value\": \"this is a second string constant that functions as a global\"\n}"

h.helicsBrokerDisconnect(brk)
h.helicsQueryFree(q)
Expand Down Expand Up @@ -109,7 +109,7 @@ end
h.helicsFederateSetGlobal(fed, "testglobal", globalVal)
q = h.helicsCreateQuery("global", "testglobal")
res = h.helicsQueryExecute(q, fed)
@test res == "{\n \"name\" : \"testglobal\",\n \"value\" : \"this is a string constant that functions as a global\"\n}"
@test res == "{\n \"name\": \"testglobal\",\n \"value\": \"this is a string constant that functions as a global\"\n}"
h.helicsFederateSetGlobal(fed, "testglobal2", globalVal2)
h.helicsQueryFree(q)
q = h.helicsCreateQuery("global", "testglobal2")
Expand All @@ -118,7 +118,7 @@ end
sleep(0.20)
end
res = h.helicsQueryExecuteComplete(q)
@test res == "{\n \"name\" : \"testglobal2\",\n \"value\" : \"this is a second string constant that functions as a global\"\n}"
@test res == "{\n \"name\": \"testglobal2\",\n \"value\": \"this is a second string constant that functions as a global\"\n}"

q2 = h.helicsCreateQuery("", "isinit")
h.helicsQueryExecuteAsync(q2, fed)
Expand Down
Loading