Commit Graph

100 Commits

Author SHA1 Message Date
Martin Diehl d6b1423c20 enable type hints for Colormap
custom constructor ensures that type of color is always an np.ndarray
2024-03-02 13:31:24 +05:30
Martin Diehl a8e979e904
ensure that files are closed automatically
reported by Karo Sedighiani
2023-12-23 07:07:12 +01:00
Martin Diehl c0a97a93fe do not overwrite input, use specialized function 2023-11-20 12:27:23 +01:00
Martin Diehl 39dacbc972 easier to understand 2023-11-20 11:49:59 +01:00
Philip Eisenlohr d8baf3c754 reset field to average of bounds avoiding casting masked NaNs 2023-11-18 20:06:15 -05:00
Philip Eisenlohr 782a593bf2 separate import of vtk modules
vtk is a collection of modules. Some are missing in some installations, so it is recommended to import only the functionality that is needed.
2023-03-08 18:03:22 +00:00
Philip Eisenlohr 06201da5e2 Improvements to Python docstrings 2023-02-21 15:27:06 +00:00
Martin Diehl dcdc4acbd5 Unified object.comments as list[str]; simplifications of Python code 2022-12-13 18:32:19 +00:00
Philip Eisenlohr 6315f97f4a added explicit Optional type hint 2022-11-22 16:26:15 -05:00
Philip Eisenlohr cbe2e74cdd Collection of small polishing steps 2022-11-22 14:39:51 +00:00
Philip Eisenlohr fa69a1876b unify X or list/seq/collection of X --> (A/B/C of) X in docstrings 2022-11-14 09:09:45 -05:00
d.mentock 3492dfcd3b Adding consistency to docstring structure 2022-07-08 18:07:07 +02:00
d.mentock df1f362ed3 it's useful for users to see standard docstrings in magic methods 2022-07-08 18:06:41 +02:00
d.mentock b9214fcc6c Prevent windows overflow error when using numpy dtype=int instead of int64 2022-06-02 19:40:18 +02:00
Martin Diehl f3cf67d3fa avoid code duplication and inconsistencies 2022-03-27 09:55:20 +02:00
Martin Diehl 0d22cfb83d table.__init__ now has common order of arguments (label, data) 2022-03-11 22:31:35 +01:00
Philip Eisenlohr 320ab70270 Merge branch 'development' into 'python-vtk-improvements'
# Conflicts:
#   python/damask/_vtk.py
2022-02-23 14:20:52 +00:00
Philip Eisenlohr 47dcd4bd41 follow Python exception message convention of lower-case 2022-02-22 10:42:05 -05:00
Philip Eisenlohr aeb0e527ec Consistent formatting of raised messages 2022-02-22 09:46:12 -05:00
Martin Diehl 9fe51686e5 allow to use '~' in path
not sure how to test, i.e. how to create a fixture to have a fake home
2022-02-21 07:19:05 +01:00
Martin Diehl df96110733 some suggestions from prospector/pylint 2022-01-29 22:38:17 +01:00
Martin Diehl ce4591fa29 silence prospector on Python 3.9 2022-01-29 19:15:40 +01:00
Martin Diehl 609f13c590 Python 3.8 magic: The walrus operator ":=" 2022-01-29 18:29:42 +01:00
Martin Diehl bc667888ce consistent style 2022-01-26 23:37:07 +01:00
Daniel Otto de Mentock 0c21b6a8e0 [skip ci] changed almost all function definition lines to multiline for colormap, grid, table, vtk and util modules 2022-01-26 16:25:27 +01:00
Martin Diehl 7c72bd48fb simplified 2022-01-24 15:07:47 +01:00
Philip Eisenlohr 6bd23715b8 added multiplication as color repeat functionality 2022-01-24 11:56:33 +01:00
Daniel Otto de Mentock 77f22318a8 Typehint improvements 2022-01-20 11:52:56 +00:00
Martin Diehl 3acabcdc7f docstring adjustments 2022-01-12 23:57:21 +01:00
Martin Diehl 410a515afc allow flexible arguments for 1D arguments 2022-01-12 13:18:38 +00:00
Martin Diehl 508083082d simplified 2021-12-21 23:50:43 +01:00
Martin Diehl 0468bfd3e1 Use ArrayLike for numpy >= 1.20 2021-12-18 17:21:46 +00:00
Philip Eisenlohr 32595299c9 minimal clean API for Colormap.at 2021-12-13 17:44:24 -05:00
Eureka Pai 2b6283bbe3 flexibility to return with alpha channel and/or as string 2021-12-10 12:53:01 -05:00
Franz Roters 7bb6707b0e [skip ci] Web page was moved 2021-12-10 18:07:04 +01:00
Eureka Pai 947bf946e1 added Colormap.at(fraction) to interpolate 2021-12-10 11:31:26 -05:00
Philip Eisenlohr b57351045b follow new convention for "shape" and "len" in docstrings 2021-12-04 03:39:33 +01:00
Martin Diehl 2a6b37a0e5 eq. according to mypy recommendation
note that raising 'NotImplemented' means that __eq__ of the 'other' is
evaluated
https://stackoverflow.com/questions/54801832
https://newbedev.com/why-does-defining-the-argument-types-for-eq-throw-a-mypy-type-error
2021-12-03 12:35:25 +01:00
Martin Diehl 99166a7ce2 Merge remote-tracking branch 'origin/colormap-docstrings' into development 2021-12-03 12:18:24 +01:00
Philip Eisenlohr dc3db90ce0 fixed typo: colormodel --> color model 2021-12-02 18:59:31 -05:00
Martin Diehl 5abfe3c214 Merge remote-tracking branch 'origin/development' into MSC-Version 2021-12-01 15:35:49 +01:00
Martin Diehl 3a51e1119b text files on Unix should end with a new line character 2021-11-30 13:11:40 +01:00
Philip Eisenlohr 4d63da6aee get_file_handle suffix is optional 2021-11-26 11:34:43 -05:00
Martin Diehl 4ba7c9e670 polishing
casting numpy.bool_ to bool is a little bit annoying. Mabye using Union[bool, np.bool_] is the better
solution, it does not require any changes to the actual code and there is some
hope that it will get fixed in mypy https://github.com/numpy/numpy/issues/18876
2021-11-25 21:29:34 +01:00
Philip Eisenlohr bd908dc425 test __eq__; polish help strings 2021-11-25 13:14:34 -05:00
Martin Diehl fb8c515a98 capitalize constants
not sure whether we should make exceptions for k_B and T_room
2021-11-25 11:52:52 +01:00
Martin Diehl 3cae915e47 not needed
a = [] is already a list
2021-11-24 21:12:13 +01:00
Martin Diehl 757ba4dba2 in-line with pathlib.Path 2021-11-24 17:28:00 +01:00
Philip Eisenlohr 3bf10127b8 added __eq__ and test 2021-11-23 17:46:38 -05:00
Philip Eisenlohr 3e1a6dcab7 polished help; streamlined from_range() 2021-11-23 17:20:07 -05:00