BlackHolePerturbationToolkit / PerturbationEquations

MIT License
5 stars 1 forks source link

Multiple definitions error when loading package #1

Closed samdupton closed 1 year ago

samdupton commented 1 year ago

When loading the package for the first time, I receive a list of error messages:

ValidateSymbol::used: Symbol S2 is already used as a manifold.
DefMetric::old: There are already metrics {\[CapitalOmega]} in vbundle \[DoubleStruckCapitalT]S2.
ValidateSymbol::used: Symbol \[CapitalOmega] is already used as a metric.
ValidateSymbol::used: Symbol R2 is already used as a manifold.
General::stop: Further output of ValidateSymbol::used will be suppressed during this calculation.
DefMetric::old: There are already metrics {q} in vbundle \[DoubleStruckCapitalT]R2.
DefMetric::old: There are already metrics {g} in vbundle \[DoubleStruckCapitalT]M4.
General::stop: Further output of DefMetric::old will be suppressed during this calculation.

I have tried running the package multiple times in the same kernel session and I receive the same errors.

I am using xTensor 1.2.0 and Mathematica 13.2.0.0.

samdupton commented 1 year ago

I looked into this a bit more and I think this is a symptom of a slightly different problem. When loading the package in Mathematica, a red button appears on the RHS of the cell with the Get command which says "Show Messages / Retry" when hovering over it. I think it's this that causes this error as when you click it, it doesn't show any messages, it just tries to reload the package causing the error with multiple definitions.

To figure out why this button appears, I had a look at the Stack using the Debugger facility and the code breaks at these points:

Message[Syntax::com, (line 502 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 503 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 504 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 505 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 507 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 560 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 561 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 562 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 563 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 599 of "SchwarzschildPerturbations.wl")]
Message[Syntax::com, (line 600 of "SchwarzschildPerturbations.wl")]

The lines of code these refer to all seem to be of the form:

If[MemberQ[___,___],,Message[SchwarzschildSource::argserror,Source]]
barrywardell commented 1 year ago

These have now been fixed.