First time here? Check out the FAQ!
1

Unexpected auto-completer behavior when working with pymatgen.

Hi,

I use the pymatgen package for doing some simple tests as following:

import pymatgen

si = pymatgen.Element("Si")
print('\n'.join(dir(si)))

The above command will give the following output:

X
__class__
__doc__
__module__
as_dict
atomic_mass
atomic_radius
average_anionic_radius
average_cationic_radius
average_ionic_radius
block
common_oxidation_states
data
from_Z
from_dict
from_row_and_group
full_electronic_structure
ground_state_term_symbol
group
icsd_oxidation_states
ionic_radii
is_actinoid
is_alkali
is_alkaline
is_chalcogen
is_halogen
is_lanthanoid
is_metal
is_metalloid
is_noble_gas
is_post_transition_metal
is_quadrupolar
is_rare_earth_metal
is_transition_metal
is_valid_symbol
iupac_ordering
max_oxidation_state
metallic_radius
min_oxidation_state
name
nmr_quadrupole_moment
number
oxidation_states
print_periodic_table
row
term_symbols
valence
value

But, when I input this si.F<tab>, it will also give completion suggestion like this: si.Fe which is obviously incorrect. Any hints for this problem?

Regards

hongyi-zhao's avatar
547
hongyi-zhao
asked 2020-05-09 09:05:49 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2020-06-04 15:12:30 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

si.Fe is actually valid, though it's not the preferred way of accessing the instance for Fe. What's happening is dir is returning a subset of all the attributes but Wing is displaying all of them. We may change Wing is match dir()'s behavior in a future release.

Wingware Support's avatar
4.1k
Wingware Support
answered 2020-05-11 11:04:55 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer