Skip to content

np.pi error  #9

Description

@margiofabiolad

Hi,

I try to use PyUltraLight for some simulations but when I run

PyUltraLight.evolve(central_mass, num_threads, length, length_units, resol, duration, duration_units, step_factor, save_number, save_options, save_path, npz, npy, hdf5, s_mass_unit, s_position_unit, s_velocity_unit, solitons, start_time).Complete

I get the error:

AttributeError Traceback (most recent call last) Input In [5], in <cell line: 1>() ----> 1 PyUltraLight.evolve(central_mass, num_threads, length, length_units, resol, duration, duration_units, step_factor, save_number, save_options, save_path, npz, npy, hdf5, s_mass_unit, s_position_unit, s_velocity_unit, solitons, start_time)

File ~/anaconda3/envs/pyultralight/PyUltraLight/PyUltraLight.py:505, in evolve(central_mass, num_threads, length, length_units, resol, duration, duration_units, step_factor, save_number, save_options, save_path, npz, npy, hdf5, s_mass_unit, s_position_unit, s_velocity_unit, solitons, start_time) 503 rfft_rho = pyfftw.builders.rfftn(rho, axes=(0, 1, 2), threads=num_threads) 504 phik = rfft_rho(rho) # not actually phik but phik is defined in next line --> 505 phik = ne.evaluate("-4*np.pi*phik/rkarray2") 506 phik[0, 0, 0] = 0 507 irfft_phi = pyfftw.builders.irfftn(phik, axes=(0, 1, 2), threads=num_threads)

File ~/anaconda3/envs/pyultralight/lib/python3.9/site-packages/numexpr/necompiler.py:809, in evaluate(ex, local_dict, global_dict, out, order, casting, **kwargs) 807 expr_key = (ex, tuple(sorted(context.items()))) 808 if expr_key not in _names_cache: --> 809 _names_cache[expr_key] = getExprNames(ex, context) 810 names, ex_uses_vml = _names_cache[expr_key] 811 arguments = getArguments(names, local_dict, global_dict)

File ~/anaconda3/envs/pyultralight/lib/python3.9/site-packages/numexpr/necompiler.py:696, in getExprNames(text, context) 695 def getExprNames(text, context): --> 696 ex = stringToExpression(text, {}, context) 697 ast = expressionToAST(ex) 698 input_order = getInputOrder(ast, None)

File ~/anaconda3/envs/pyultralight/lib/python3.9/site-packages/numexpr/necompiler.py:289, in stringToExpression(s, types, context) 287 names.update(expressions.functions) 288 # now build the expression --> 289 ex = eval(c, names) 290 if expressions.isConstant(ex): 291 ex = expressions.ConstantNode(ex, expressions.getKind(ex))

File <expr>:1, in <module>

AttributeError: 'VariableNode' object has no attribute 'pi'

Is there any way to resolve this error?

regards,
Margionet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions