Skip to content

Commit

Permalink
Merge pull request #109 from MineralsCloud:fix
Browse files Browse the repository at this point in the history
Fix imports of `ReciprocalPoint` to `SpecialPoint`
  • Loading branch information
singularitti authored Oct 10, 2023
2 parents ce8d91f + 97c51c3 commit c1679ab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.4.0"

[deps]
AbInitioSoftwareBase = "df5135bc-470e-46c6-b451-292e27ca5b84"
Crystallography = "3bff3928-7a76-11e9-2089-d112443085a5"
CrystallographyBase = "93b1d1cd-a8ea-4aa5-adb1-b2407ea0ba8d"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PyFortran90Namelists = "e44308e6-bd5b-11e9-2850-49daf8f1ec40"
Expand All @@ -15,7 +15,6 @@ VersionParsing = "81def892-9a0e-5fdd-b105-ffc91e053289"

[compat]
AbInitioSoftwareBase = "0.10"
Crystallography = "0.3, 0.4, 0.5, 0.6"
DataFrames = "0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 1"
Parameters = "0.10, 0.11, 0.12"
PyFortran90Namelists = "0.1"
Expand Down
5 changes: 2 additions & 3 deletions src/PHonon/input.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

using AbInitioSoftwareBase: Namelist, groupname
using Crystallography: ReciprocalPoint
using PyFortran90Namelists: fparse
using QuantumESPRESSOBase.PHonon:
ReciprocalPoint,
SpecialPoint,
QPointsCard,
PhInput,
Q2rInput,
Expand Down Expand Up @@ -44,7 +43,7 @@ function Base.tryparse(::Type{QPointsCard}, str::AbstractString)
captured = only(m.captures)
data = map(eachmatch(Q_POINTS_SPECIAL_ITEM_REGEX, captured)) do matched
# TODO: Match `nqs`
ReciprocalPoint(map(x -> fparse(Float64, x), matched.captures))
SpecialPoint(map(x -> fparse(Float64, x), matched.captures))
end
return QPointsCard(data)
end
Expand Down
7 changes: 4 additions & 3 deletions src/PWscf/input.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using AbInitioSoftwareBase: groupname
using Crystallography: ReciprocalPoint, MonkhorstPackGrid
using CrystallographyBase: MonkhorstPackGrid
using PyFortran90Namelists: fparse
using QuantumESPRESSOBase: Card
using AbInitioSoftwareBase: Card
using QuantumESPRESSOBase: SpecialPoint
using QuantumESPRESSOBase.PWscf:
ControlNamelist,
SystemNamelist,
Expand Down Expand Up @@ -232,7 +233,7 @@ function Base.tryparse(::Type{SpecialPointsCard}, str::AbstractString)
return SpecialPointsCard(
map(eachmatch(K_POINTS_SPECIAL_ITEM, m.captures[2])) do matched
# TODO: Match `nks`
ReciprocalPoint(map(x -> fparse(Float64, x), matched.captures)...)
SpecialPoint(map(x -> fparse(Float64, x), matched.captures)...)
end,
option,
)
Expand Down
2 changes: 1 addition & 1 deletion test/PWscf/input.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test

using Crystallography
using CrystallographyBase
using QuantumESPRESSOBase.PWscf
using QuantumESPRESSOParser

Expand Down
7 changes: 3 additions & 4 deletions test/PWscf/output.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using QuantumESPRESSOParser.PWscf
@test parse_ibz(str) == (
KPointsCard(
"tpiba",
SpecialPoint[
[
SpecialPoint([0.0625, 0.0625, 0.0625], 0.0078125),
SpecialPoint([0.0625, 0.0625, 0.1875], 0.0234375),
SpecialPoint([0.0625, 0.0625, 0.3125], 0.0234375),
Expand All @@ -62,9 +62,8 @@ using QuantumESPRESSOParser.PWscf
SpecialPoint([0.0625, 0.0625, 0.8125], 0.0234375),
SpecialPoint([0.0625, 0.0625, 0.9375], 0.0234375),
SpecialPoint([0.0625, 0.1875, 0.1875], 0.0234375),
SpecialPoint([0.0625, 0.1875, 0.3125], 0.046875) SpecialPoint(
[0.3125, 0.3125, 0.3125], 0.0078125
),
SpecialPoint([0.0625, 0.1875, 0.3125], 0.046875)
SpecialPoint([0.3125, 0.3125, 0.3125], 0.0078125),
SpecialPoint([0.3125, 0.3125, 0.4375], 0.0234375),
SpecialPoint([0.3125, 0.3125, 0.5625], 0.0234375),
SpecialPoint([0.3125, 0.3125, 0.6875], 0.0234375),
Expand Down

0 comments on commit c1679ab

Please sign in to comment.