Closed rieder closed 2 years ago
with the exception of some str <-> unicode errors, they don't look python3 specific.. random comments:
:
the TypeError: slice indices must be integers
is caused by an integer devision becoming float targetN in evrard_test.py)
the hydrodynamicsclass problem is caused by setting something (gas_particles) that is also defined a property..
(i think, but not tested, that the property must be removed)
- I don't think the scripts have a reason to import or use AmuseExceptions..
Actually, this error originates higher up, in amuse.io.store_v1
. Fixed now.
hydro_grid_minimal.py needs work. It's simply not working at some point (a line that's literally "xxx"). I'm replacing that with an exit()
for now.
fixed some of the issues now.
Good day!
Most likely both of these questions are very stupid, but:
Is there any list of updated and reliable examples that can be used as a reference and which are definitely functional?
Is it possible to use examples as very computationally expensive tests to check the computational reproducibility of different versions of AMUSE on different devices?
Thank you very much for your attention!
Hi @gekaremi, Re 1): there is no such list. All examples should work, hence this issue. Re 2): you can certainly use the examples as such tests, but they are definitely not designed to be "very computationally expensive". A small comment: please could you next time open a new issue for questions? This helps us in keeping track of different issues/questions/bugs.
AttributeError: You tried to access attribute 'mass' but this attribute is not defined for this set.
(2017arXiv170307029H_Fig3.py)"gas"
and "Star"
to b"gas"
and b"Star"
(or checking against str(bi.name)
), but this is ugly... @ipelupessy could we fix this with an automatic conversion from bytes to strings in store_v1 (or store_v2)?@rieder do you know the line in store_v1/2 where this is a problem?
ok, I see it is not a problem of store_v1..I would adapt the 2017.. script to match the byte string type:
if hasattr(bi, "name") and numpy.bytes_("gas") in bi.name:
disk.add_particles(bi.copy())
elif numpy.bytes_("Star") in bi.name:
stars.add_particles(bi.copy())
the code is a bit ugly anyway..
I am not sure what happens to string attributes that are saved with python3 store now; I think the also be byte strings now, but I am not sure that is the case...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.
The only remaining issue is with strings in amuse stores now?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.
open new issue for any remaining
I am finding several problems with the Textbook examples (which really all should work for a clean, full AMUSE installation), at least in the Python3 version (PR #193). These should be fixed. I did not test with codes like MESA and Mocassin nor did I run very long scripts, so there could be more problems.
This is a tracker issue.
Causes for the scripts to fail include:
NameError: name 'AmuseException' is not defined
(if an error is generated, e.g. if h5py is not available) --> AmuseException is not imported in lab.py, which the scripts seem to assume.AttributeError: You tried to access attribute 'mass' but this attribute is not defined for this set.
(2017arXiv170307029H_Fig3.py)ModuleNotFoundError: No module named 'local_star_to_sph'
(1987ApJ...323..614B.py)ModuleNotFoundError: No module named 'initialize_sstars'
(gravity_class.py, plot_sstar_orbits.py)python3 type changes (TypeError: a bytes-like object is required, not 'str'
) -> compare_disk_size_Trapezium.pyTypeError: slice indices must be integers or None or have an __index__ method
(hydro_experiment.py, rad_experiment.py)IndexError: an index can only have a single ellipsis ('...')
(hydro_grid_minimal.py)TabError: inconsistent use of tabs and spaces in indentation
(hydrodynamics_class.py)NameError: name 'self' is not defined
(kelvin_helmholtz.py)AttributeError: can't set attribute
(molecular_cloud_collapse_with_sinks.py)UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)
SyntaxError: import * only allowed at module level
(riemann_shock_tube_problem.py)