Skip to content

Change naming convension#234

Open
sshin23 wants to merge 1 commit intomainfrom
ss/naming
Open

Change naming convension#234
sshin23 wants to merge 1 commit intomainfrom
ss/naming

Conversation

@sshin23
Copy link
Copy Markdown
Collaborator

@sshin23 sshin23 commented Mar 1, 2026

This PR changes

Par to Data to avoid naming conflicts with Parameter

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/ext/ExaModelsMOI.jl b/ext/ExaModelsMOI.jl
index 64b3f7e..29bc7bb 100644
--- a/ext/ExaModelsMOI.jl
+++ b/ext/ExaModelsMOI.jl
@@ -487,7 +487,7 @@ function _exafy(e::MOI.ScalarAffineFunction{T}, var_to_idx, p = ()) where {T}
             c1, p = _exafy(term, var_to_idx, p)
             c1
         end for term in e.terms) +
-        ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
+            ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
     else
         ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
     end
diff --git a/src/gradient.jl b/src/gradient.jl
index 39a677e..21fca26 100644
--- a/src/gradient.jl
+++ b/src/gradient.jl
@@ -68,7 +68,7 @@ Performs dsparse gradient evaluation via the reverse pass on the computation (su
     o1,
     cnt,
     adj,
-) where {D<:Union{AdjointNull,DataIndexed,Real}}
+    ) where {D <: Union{AdjointNull, DataIndexed, Real}}
     return cnt
 end
 @inline function grpass(d::D, comp, y, o1, cnt, adj) where {D<:AdjointNode1}
diff --git a/src/graph.jl b/src/graph.jl
index b85df20..ef53e39 100644
--- a/src/graph.jl
+++ b/src/graph.jl
@@ -79,11 +79,11 @@ A parameterized data node
 # Fields:
 - `inner::I`: parameter for the data
 """
-struct DataIndexed{I,J} <: AbstractNode
+struct DataIndexed{I, J} <: AbstractNode
     inner::I
 end
 
-@inline DataIndexed(inner::I, n) where {I} = DataIndexed{I,n}(inner)
+@inline DataIndexed(inner::I, n) where {I} = DataIndexed{I, n}(inner)
 """
     Node1{F, I}
 
@@ -119,7 +119,7 @@ end
 
 @inline Base.getproperty(n::DataSource, s::Symbol) = DataIndexed(n, s)
 @inline Base.getindex(n::DataSource, i) = DataIndexed(n, i)
-@inline Base.indexed_iterate(n::P, idx, start = 1) where P <: Union{DataSource, DataIndexed} = (DataIndexed(n, idx), idx + 1)
+@inline Base.indexed_iterate(n::P, idx, start = 1) where {P <: Union{DataSource, DataIndexed}} = (DataIndexed(n, idx), idx + 1)
 
 @inline Base.getproperty(v::DataIndexed{I, n}, s::Symbol) where {I, n} = DataIndexed(v, s)
 @inline Base.getindex(v::DataIndexed{I, n}, i) where {I, n} = DataIndexed(v, i)
@@ -148,7 +148,7 @@ struct Identity end
 @inline (v::ParameterNode{I})(::Identity, x, ::Nothing) where {I<:AbstractNode} = NaN
 
 @inline (v::DataSource)(i, x, θ) = i
-@inline (v::DataIndexed{I,n})(i, x, θ) where {I,n} = @inbounds getfield(getfield(v, :inner)(i, x, θ), n)
+@inline (v::DataIndexed{I, n})(i, x, θ) where {I, n} = @inbounds getfield(getfield(v, :inner)(i, x, θ), n)
 
 (v::DataIndexed)(i::Identity, x, θ) = NaN # despecialized
 (v::DataSource)(i::Identity, x, θ) = NaN # despecialized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant