E0001: Syntax outside the Edge profile

SeverityPyneCore raises
errorSyntaxError

Message:

{construct} is not allowed in the Pyne Edge profile.

The Pyne Edge profile is the subset of Python that is enough for everything a Pine Script program needs: every Pine script can be written in it. This construct is outside it; a full @pyne script can use it.

E0002: Python built-in instead of the Pine one

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is Python's built-in here, which is not allowed in the Pyne Edge profile. For {meaning}, import it: `from pynecore.lib import {name}`.

Without the import, the name means Python’s own built-in, not the Pine function of the same name.

E0003: lambda outside a field default

SeverityPyneCore raises
errorSyntaxError

Message:

`lambda` is allowed only as a `field(default_factory=...)` default of a field.

The Pyne Edge profile has no function values. The one lambda it takes builds a field’s default value.

E0004: assert message that is not a string literal

SeverityPyneCore raises
errorSyntaxError

Message:

An `assert` message must be a string literal in the Pyne Edge profile.

The message is fixed text, as Pine’s own messages are: the profile has no use for one built while the script runs.

E0005: Assignment to a subscript

SeverityPyneCore raises
errorSyntaxError

Message:

Assigning to a subscript is not allowed in the Pyne Edge profile; use `array.set()`.

An array element is set with array.set(id, index, value).

E0006: Import outside the Edge profile

SeverityPyneCore raises
errorSyntaxError

Message:

{import} is not allowed in the Pyne Edge profile: only the PyneCore API and `lib.*` libraries can be imported.

Relative imports, star imports and modules other than the PyneCore API and the user’s lib.* libraries are outside the profile.

E0007: Decorator outside the Edge profile

SeverityPyneCore raises
errorSyntaxError

Message:

Only `@script.indicator/strategy/library(...)`, `@method` and `@export` can decorate a function in the Pyne Edge profile.

Other decorators change a function while the script runs, which nothing in Pine needs.

E0008: Class outside the Edge profile

SeverityPyneCore raises
errorSyntaxError

Message:

{detail} A class in the Pyne Edge profile is a `@udt` or `@dataclass` field list with methods, or an enum.

A class has exactly one @udt or @dataclass decorator, no base classes or keywords, and a body of annotated fields and undecorated methods that take their receiver first.

An enum is the other class form: its single base is StrEnum imported from enum, it takes no decorator, and its body holds member = 'title' assignments only.

E0009: Call outside the Edge profile

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` cannot be called in the Pyne Edge profile: only defined functions, imported names and {builtins} can.

A call goes to a function of the script, an imported name, or one of the few Python built-ins the profile keeps.

E0010: Attribute set on a function or module

SeverityPyneCore raises
errorSyntaxError

Message:

Assigning an attribute on `{root}` is not allowed in the Pyne Edge profile: functions and modules are not objects.

Only objects of user-defined types have fields to set.

E0011: Double-underscore name

SeverityPyneCore raises
errorSyntaxError

Message:

The name `{name}` is not allowed in the Pyne Edge profile: double-underscore names belong to PyneCore's transform.

PyneCore’s transform names its own functions and variables with double underscores, and a Pine script has no such names. Rename the identifier.

E0012: Name without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` has no known type.

The Pyne Edge profile types every value the way Pine does. The value this name holds could not be typed; give it a value of a known type, or annotate it.

E0013: Function used as a value

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is a function, not a value.

Pine has no function values: a function is called where it is used, never stored or passed.

E0014: Call without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

The call to `{callee}` has no known type.

What the called function returns could not be typed. Annotate its return, or the parameters its result depends on.

E0015: Call of an unknown callee

SeverityPyneCore raises
errorSyntaxError

Message:

This call has no known type.

The called expression is not a name, so what it returns cannot be typed. Call a defined function or a lib name.

E0016: Method call without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

The call to the method `{method}` has no known type.

What the method returns could not be typed. Annotate its return, or its receiver’s type.

E0017: Lib call without a known type here

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` has no known type here.

The lib function has no overload for the argument types it gets here. Give its arguments known types.

E0018: Unknown lib name

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is not a lib name.

The name is not part of pynecore.lib. Check its spelling.

E0019: Field without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

`.{field}` has no known type on `{type}`.

The field could not be typed on this value. Declare the field on a @udt class.

E0020: Index without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

Indexing `{type}` has no known type.

Only a series, a tuple, or an array read through array.get() can be indexed with a known result type.

E0021: Operation without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

`{expression}` has no known type over {operands}.

The operation does not take these operand types together. Give the operands types the operation accepts.

E0022: Expression outside Pine

SeverityPyneCore raises
errorSyntaxError

Message:

`{expression}` is not a Pine expression.

The expression has no Pine counterpart. Write it with Pine constructs only.

E0023: Two types for one value

SeverityPyneCore raises
errorSyntaxError

Message:

{what} gets both `{first}` and `{second}`, which are different types.

A Pine variable has one type. Make every branch, or every assignment, give it the same type.

E0024: Starred unpacking target

SeverityPyneCore raises
errorSyntaxError

Message:

A starred target takes an unknown number of elements, which Pine has no form for.

Unpack exactly as many names as the tuple has elements.

E0025: Unpacking count mismatch

SeverityPyneCore raises
errorSyntaxError

Message:

`{type}` has {count} elements, and this unpacks {names}.

Unpack as many names as the tuple has elements.

E0026: Overload differs per call context

SeverityPyneCore raises
errorSyntaxError

Message:

The overload chosen for this call differs per call context: {pins}.

The same call site would take a different overload depending on where its function is called from. Annotate the parameters so every call site agrees.

E0027: Conversion differs per call context

SeverityPyneCore raises
errorSyntaxError

Message:

The implicit conversion of a value differs per call context, and not every instance can be given its own.

Annotate the parameters so every call site passes the same types.

E0028: Collection operand without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

`{type}` takes an operand whose type is not known here, so what it holds afterwards is not known either.

Give the operand a known type.

E0029: Collection operand of another element type

SeverityPyneCore raises
errorSyntaxError

Message:

`{type}` cannot take `{other}`: the elements are different types.

Pass a collection of the same element type.

E0030: Function name assigned

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is assigned as well as defined, so what it calls is unknown.

A call is typed from the function its name defines. Call it under a name nothing assigns to.

E0031: Name imported twice

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is imported more than once, so what it calls is unknown.

Import the name once, under a name nothing else binds.

E0032: Imported name assigned

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is assigned as well as imported, so what it calls is unknown.

Call the import under a name nothing assigns to.

E0033: Re-entrant call

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` is re-entrant, so its result type is unknown.

A recursive call is typed from the function’s annotations. Annotate the parameters and the return of the recursive function.

E0034: Too many call contexts

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` hit the per-module context limit.

The function is called with too many distinct argument types. Call it with fewer, or annotate its parameters.

E0035: Import without annotations

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is imported from `{source}`, where its parameters carry no annotations, so what it returns is unknown.

An imported function is typed from its annotations. Annotate its parameters in the module it comes from.

E0036: Import of a reported module

SeverityPyneCore raises
errorSyntaxError

Message:

`{module}` is reported, and no type it publishes may drive a dispatch here: {reason}.

The imported module has errors of its own. Fix that module first.

E0037: Import cycle

SeverityPyneCore raises
errorSyntaxError

Message:

`{module}` imports this module back, so its signatures are not available yet.

Break the import cycle between the two modules.

E0038: For loop over a non-iterable

SeverityPyneCore raises
errorSyntaxError

Message:

`{expression}` is a `{type}`; a for loop iterates a range or an array.

Loop over range(...) or an array.

E0039: Indexing outside Pine

SeverityPyneCore raises
errorSyntaxError

Message:

Indexing `{type}` is not Pine.

Read elements with array.get, matrix.get or map.get.

E0040: History of a plain value

SeverityPyneCore raises
errorSyntaxError

Message:

`{expression}` is a plain `{type}`, not a series.

Only a series keeps its history. Declare the variable as a Series to read its past values.

E0041: Assignment of another type

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is declared `{declared}` and assigned `{assigned}`.

Declare the variable with the type it is assigned, or assign the declared type.

E0042: Field assigned another type

SeverityPyneCore raises
errorSyntaxError

Message:

`{field}` holds `{declared}` and is assigned `{assigned}`.

Assign a value of the field’s type.

E0043: Unknown function

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is not a function this module defines or imports, nor a lib name.

Define the function, import it, or call a lib name.

E0044: Callee is not a name

SeverityPyneCore raises
errorSyntaxError

Message:

The callee is not a name.

Call a defined function or a lib name.

E0045: Field of a value of unknown class

SeverityPyneCore raises
errorSyntaxError

Message:

The class of `{value}` is not known here, so its field `{field}` has no type.

Annotate the value with the type it holds.

E0046: Method of a value of unknown class

SeverityPyneCore raises
errorSyntaxError

Message:

The class of `{value}` is not known here, so its method `{method}` has no type.

Annotate the receiver with the type it holds.

E0047: Field set on a value of unknown class

SeverityPyneCore raises
errorSyntaxError

Message:

The class of `{value}` is not known here, so its field `{field}` cannot be checked.

Annotate the value with the type it holds.

E0048: Unknown field

SeverityPyneCore raises
errorSyntaxError

Message:

`{owner}` has no field `{field}`.

Declare the field on the class, or use a field it has.

E0049: Field set on a value without fields

SeverityPyneCore raises
errorSyntaxError

Message:

A `{type}` has no field `{field}` to assign.

Only objects of a @udt class have fields to set.

E0050: Unknown loop counter field

SeverityPyneCore raises
errorSyntaxError

Message:

The loop counter has no field `{field}`.

Read value or entering, or call step or enter.

E0051: Lib namespace called

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is a lib namespace, not a function.

Call a function in the namespace.

E0052: Lib value called

SeverityPyneCore raises
errorSyntaxError

Message:

`{name}` is a lib value, not a function.

Read the value without calling it.

E0053: Unknown method

SeverityPyneCore raises
errorSyntaxError

Message:

`{method}` is not a method of `{type}` here.

Declare the method on the receiver’s class, or call a method its type has.

E0054: Method not reachable by name

SeverityPyneCore raises
errorSyntaxError

Message:

`{method}` is declared on `{type}`, but no export the runtime searches by name holds it.

Pass the method itself: method_call(method, receiver, ...).

E0055: Loop bounds without a known type

SeverityPyneCore raises
errorSyntaxError

Message:

The bounds of `{expression}` are not known here, so its counter has no type.

Give the loop bounds known numeric types.

E0056: Bound is not a number

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` takes a number for a bound, `{type}` passed.

Pass int or float bounds.

E0057: step() arity

SeverityPyneCore raises
errorSyntaxError

Message:

`step` takes 1 argument, {count} passed.

Pass the bound: step(to).

E0058: enter() arity

SeverityPyneCore raises
errorSyntaxError

Message:

`enter` takes 0 or 1 argument(s), {count} passed.

Pass the step: enter(by).

E0059: method_call() arguments

SeverityPyneCore raises
errorSyntaxError

Message:

`method_call` takes a method and a receiver.

Spell it method_call(method, receiver, ...).

E0060: Wrong number of arguments

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` does not take {count} argument(s).

Call the function the way it is declared.

E0061: Too few arguments

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` does not take {count} argument(s) (at least {least} needed).

Pass every argument the function needs.

E0062: Wrong number of positional arguments

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` takes {positional} positional argument(s), {count} passed.

Call the function the way it is declared.

E0063: Unknown parameter

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` has no parameter `{parameter}`.

Pass only the parameters the function declares.

E0064: Argument of another type

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` takes `{declared}` for `{parameter}`, `{passed}` passed.

Pass a value of the declared type.

E0065: No matching overload

SeverityPyneCore raises
errorSyntaxError

Message:

No overload of `{function}` takes these arguments.

Call it with argument types one of its overloads declares.

E0066: Argument passed twice

SeverityPyneCore raises
errorSyntaxError

Message:

`{parameter}` is passed to `{function}` twice.

Pass each argument once.

E0067: Missing argument

SeverityPyneCore raises
errorSyntaxError

Message:

`{function}` needs an argument for `{parameter}`.

Pass every parameter that has no default.

E0068: Wrong number of constructor arguments

SeverityPyneCore raises
errorSyntaxError

Message:

`{type}` has {fields} field(s), {count} argument(s) passed.

Pass at most one argument per field.

E0069: Missing field value

SeverityPyneCore raises
errorSyntaxError

Message:

`{type}` needs a value for `{field}`.

Pass every field that has no default.

E0070: Field value of another type

SeverityPyneCore raises
errorSyntaxError

Message:

`{field}` holds `{declared}`, `{passed}` passed.

Pass a value of the field’s type.

E0071: Overload not decidable

SeverityPyneCore raises
errorSyntaxError

Message:

Argument {argument} of `{function}` has no known type, so the overload this call runs is not decided.

An overloaded function is called with an argument whose type the analysis does not know: an instance of a plain class instead of a @udt one, or the value of a helper without a return annotation. Which overload runs is then decided from the values at run time, and an argument no overload takes stops the run there. Give the argument a known type: annotate it, or make its class a @udt.

E0072: Overload not decidable

SeverityPyneCore raises
errorSyntaxError

Message:

The argument types of `{function}` do not decide one overload for this call.

The static types of the arguments leave more than one overload of the function, or none the analysis can read, for this call. Which overload runs is then decided from the values at run time. Annotate the overloads’ parameters, or pass arguments whose types name one overload.