Skip to content

make featurization in FeaturizedAtoms a const once Julia 1.8 is released #137

@thazhemadam

Description

@thazhemadam

With Julia 1.8, we'll be able to declare const fields in mutable structs. We should use this to make featurization in FeaturizedAtoms a const, since the featurization assigned to a FeaturizedAtoms object shouldn't change.

diff --git a/src/featurizedatoms.jl b/src/featurizedatoms.jl
index 983cde3..b36050a 100644
--- a/src/featurizedatoms.jl
+++ b/src/featurizedatoms.jl
@@ -14,7 +14,7 @@ Container object for an atomic structure object, a featurization, and the result
 """
 struct FeaturizedAtoms{A,F<:AbstractFeaturization}
     atoms::A
-    featurization::F
+    const featurization::F
     encoded_features::Any
     FeaturizedAtoms{A,F}(atoms, featurization) where {A,F<:AbstractFeaturization} =
         new(atoms, featurization, encode(atoms, featurization))

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerslongtermCool things that probably won't happen for awhile

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions