Handling structs without the default constructor via `Expr(:new,...` ?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- julia
調査の方向性
CustomType MWE から始めて、src/differentials/composite.jl の read 構文、特にリンク先のセクションを読みます。次に、FiniteDifferences を介して型を構築する CRTU テストを調べ、その動作を issue で説明されているカスタムコンストラクターの処理と比較します。このコンストラクターパターンで、関連する CRTU のケースが失敗しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In FiniteDifferences, this PR allowed custom constructors to be handled as part of to_vec: https://github.com/JuliaDiff/FiniteDifferences.jl/pull/181 here
However iiuc construct in CRC here doesn't handle this. In this case however, the constructor requirements are mentioned in the docstring.
However, tests in CRTU will construct the new type as part of the call to FiniteDifferences but then fail later as the constructor is not found in the call to construct.
Allowing this here, or otherwise, it would be easier if these behaviours were consistent in terms of custom types as part of the CTRU testing pipeline.
EDIT: MWE:
struct CustomType{T}
x
function CustomType(X::T) where {T}
new{T}(X)
end
end
# This misses the constructor:
CustomType{Int64}(5) # ERROR: MethodError: no method matching CustomType{Int64}(::Int64)
val = CustomType(5) # CustomType{Int64}(5)
diff = Tangent{typeof(val)}(x = 5) # Tangent{CustomType{Int64}}(x = 5,)
val + diff #ERROR: MethodError: no method matching CustomType{Int64}(::Int64)
# FiniteDifferences handles this in the vec to x:
to_vec(CustomType(5))[2]([6.0]) #CustomType{Int64}(6.0)
Defining CustomType{T}(x) where {T} = CustomType(x) allows this pass.
cc @mzgubic
- 主要言語
- Julia
- スター
- 267
- フォーク
- 66
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaDiff/ChainRulesCore.jl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
JuliaDiff/ChainRulesCore.jl#712 ·
メンテナーはふだん 1 日以内に返信
-
variable scope of `@thunk`対応中かも @chengchingwen が 621 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
JuliaDiff/ChainRulesCore.jl#684 ·
メンテナーはふだん 1 日以内に返信
-
good first issue Structural Tangent
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
JuliaDiff/ChainRulesCore.jl#669 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
JuliaDiff/ChainRulesCore.jl#668 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
breaking
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
JuliaDiff/ChainRulesCore.jl#665 ·
メンテナーはふだん 1 日以内に返信
JuliaDiff/ChainRulesCore.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JuliaDiff/TaylorSeries.jl#445 ·
-
🕷️ bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CliMA/ClimaSeaIce.jl#203 ·
メンテナーはふだん 3 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
JuliaPhysics/BeamletOptics.jl#221 ·
メンテナーはふだん 1 日以内に返信
-
release preparation spack
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
30-minutes algorithm any-language codewars dart easy elixir hackerrank hacktoberfest haskell help wanted interview-prep julia leetcode lua open-source r scala students zig
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Huerte/algo-solutions-python#163 ·
メンテナーはふだん 1 日以内に返信