Skip to content

Commit

Permalink
JuliaFormatter Action Bot
Browse files Browse the repository at this point in the history
  • Loading branch information
eahenle authored Mar 5, 2023
1 parent a2bb5ae commit be4d8f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/bonds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ struct BondingRule
max_dist::Float64
end

function BondingRule(species_i::AbstractString, species_j::AbstractString, max_dist::AbstractString)
function BondingRule(
species_i::AbstractString,
species_j::AbstractString,
max_dist::AbstractString
)
return BondingRule(Symbol.([species_i, species_j])..., parse(Float64, max_dist))
end

Expand Down
6 changes: 5 additions & 1 deletion src/crystal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,11 @@ function Base.lastindex(crystal::Crystal)
end
end

function Base.:+(crystals::Crystal...; check_overlap::Bool=true, name::AbstractString="added_xtal")
function Base.:+(
crystals::Crystal...;
check_overlap::Bool=true,
name::AbstractString="added_xtal"
)
box = crystals[1].box
symmetry = crystals[1].symmetry
# all crystals must have same boxes and space group
Expand Down
11 changes: 9 additions & 2 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ Write a `Crystal` to disk in the mol2 format. Includes atoms, bonds, and unit c
- `xtal::Crystal` : the crystal to export
- `filename::AbstractString` : (Optional) the name of the file to save to. By default, file is named automatically from `xtal.name`
"""
function write_mol2(xtal::Crystal; filename::AbstractString=split(xtal.name, ".cif")[1] * ".mol2")
function write_mol2(
xtal::Crystal;
filename::AbstractString=split(xtal.name, ".cif")[1] * ".mol2"
)
# open buffer
open(filename, "w") do f
# start the MOLECULE data record
Expand Down Expand Up @@ -181,7 +184,11 @@ Warnings are issued if any chosen paths are not valid folders.
- `print_paths::Bool` : Optional. If `true`, prints contents of `rc[:paths]` to console. Defaults to `false`.
- `no_warn::Bool` : Optional. Set `true` to suppress invalid path warnings. Default to `false`.
"""
function set_paths(path_to_data::AbstractString=pwd(); print_paths::Bool=false, no_warn::Bool=false)
function set_paths(
path_to_data::AbstractString=pwd();
print_paths::Bool=false,
no_warn::Bool=false
)
for (key, path) in rc[:paths] # set all relative paths
rc[:paths][key] = joinpath(path_to_data, String(key))
end
Expand Down

0 comments on commit be4d8f2

Please sign in to comment.