alexrobomind / fusionsc

FusionSC
MIT License
1 stars 1 forks source link

`TypeError: 'ToroidalGrid.Reader' object is not callable` #1

Closed dschwoerer closed 1 year ago

dschwoerer commented 1 year ago

I tried the example from the documentation, but that does not seem to work with python3.11 or 3.8

Python 3.11.3 (main, May 24 2023, 00:00:00) [GCC 13.1.1 20230511 (Red Hat 13.1.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fusionsc as fsc
>>> from fusionsc.devices import w7x
>>> 
>>> grid = w7x.defaultGrid()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'ToroidalGrid.Reader' object is not callable

Is the documentation outdated, or is there something wrong with my setup?

alexrobomind commented 1 year ago

There is an API inconsistency between the jtext and w7x package. w7x.defaultGrid is a variable holding an immutable description of the grid, while the (newer) jtext package returns a modifiable clone of its recommended grid. Therefore, w7x.defaultGrid is not supposed to be callable. Where in the doc is it used that way?

dschwoerer commented 1 year ago

I have it from here:

https://alexrobomind.github.io/fusionsc/setup.html#pre-calculating-fields-for-biot-savart-calculation

alexrobomind commented 1 year ago

As of v2.0.0a1, this is now callable (and the documentation is fixed). I would close this issue now. Feel free to reopen if needed.