First time here? Check out the FAQ!

hongyi-zhao's profile - activity

2024-07-21 09:39:36 -0600 received badge Notable Question (source)
2024-07-19 10:53:34 -0600 received badge Famous Question (source)
2024-07-18 13:46:03 -0600 received badge Notable Question (source)
2024-07-18 13:46:03 -0600 received badge Popular Question (source)
2024-07-14 07:51:44 -0600 marked best answer Can I integrate jupyterlab in wingide to facilitate the cell-by-cell debugging?

Can I integrate jupyterlab in wingide to facilitate the cell-by-cell debugging?

Regards, Zhao

2024-07-11 09:58:20 -0600 asked a question Can I integrate jupyterlab in wingide to facilitate the cell-by-cell debugging?

Can I integrate jupyterlab in wingide to facilitate the cell-by-cell debugging? Can I integrate jupyterlab in wingide to

2024-07-03 08:51:06 -0600 marked best answer How to Handle ANSI Escape Sequences in Stack Data display?

Hi everyone,

I'm currently using Wing Pro IDE for my Python development, and I've encountered an issue while debugging. When I inspect variables or print output in the Stack Data panel, I see a lot of ANSI escape sequences (e.g., ?[4m, ?[1m, ?[0;0m). These sequences are used for text formatting, like colors and styles, but they clutter the output and make it hard to read.

Is there a way to configure Wing Pro IDE to either interpret these sequences correctly or strip them out so that the output is clean and readable?

Here is an example of the output I'm seeing:

image description

The testing code is as follows:

# Now import pymatgen and other modules
from mp_api.client import MPRester
from pymatgen.io.vasp.sets import MPRelaxSet


# Use MPRester to fetch data
with MPRester() as mpr:
    # Search for materials with chemical system "Au" and space group number 225 (Fm-3m)
    #results = mpr.materials.search(formula="Au", spacegroup_number=225)
    results = mpr.materials.search(chemsys="Au", num_elements=(1, 1), spacegroup_number=225)
    #https://next-gen.materialsproject.org/materials/mp-568430?formula=BaRh2
    # results = mpr.materials.search(formula="BaRh2", spacegroup_number=227)

    # Print results
    for result in results:
        material_id = result.material_id
        print(f"Material ID: {material_id}, Formula: {result.formula_pretty}")

        # Get material structure
        structure = mpr.materials.get_structure_by_material_id(material_id)

        # Generate VASP input files using MPRelaxSet
        vasp_input_set = MPRelaxSet(structure)
        incar = vasp_input_set.incar

        # Print INCAR file content
        print(incar)

Any suggestions or guidance on how to handle this within Wing Pro would be greatly appreciated!

Thanks in advance for your help!

Best regards, Zhao

2024-07-03 08:50:54 -0600 received badge Famous Question (source)
2024-07-03 08:50:54 -0600 received badge Popular Question (source)
2024-07-03 08:50:54 -0600 received badge Notable Question (source)
2024-07-03 08:49:49 -0600 marked best answer The editable mode installed package by pip cannot be completed by default.

It seems that the editable mode installed package by pip cannot be completed by default. In order to enable the completion for them, I must add the package directory into wing's python path, as shown below:

image description

However, this method becomes very inconvenient if I have many such installed packages. I wonder if there is a better solution to this problem.

Regards, Zhao

2024-07-03 08:49:40 -0600 received badge Popular Question (source)
2024-07-03 08:49:40 -0600 received badge Notable Question (source)
2024-07-03 08:49:40 -0600 received badge Famous Question (source)
2024-06-24 19:05:15 -0600 commented answer The editable mode installed package by pip cannot be completed by default.

Yes. It does the trick. See https://stackoverflow.com/questions/76301782/why-are-pycharm-and-pylance-not-detecting-packa

2024-06-24 01:07:40 -0600 asked a question The editable mode installed package by pip cannot be completed by default.

The editable mode installed package by pip cannot be completed by default. It seems that the editable mode installed pac

2024-06-04 05:26:17 -0600 answered a question How to Handle ANSI Escape Sequences in Stack Data display?

I tried with the following code, but failed to do the trick: import os import re from typing import Any def strip_ansi

2024-06-04 05:26:17 -0600 received badge Rapid Responder ( source )
2024-06-03 10:23:42 -0600 edited question How to Handle ANSI Escape Sequences in Stack Data display?

How to Handle ANSI Escape Sequences in Stack Data display? Hi everyone, I'm currently using Wing Pro IDE for my Python

2024-06-03 10:21:51 -0600 asked a question How to Handle ANSI Escape Sequences in Stack Data display?

How to Handle ANSI Escape Sequences in Stack Data display? Hi everyone, I'm currently using Wing Pro IDE for my Python

2024-05-25 07:16:32 -0600 marked best answer How to disable writing main.update-history information to ~/.wingpro10/preferences?

Currently, I have the following ~/.wingpro10/preferences file:

werner@x13dai-t:~$ cat ~/.wingpro10/preferences 
[user-preferences]
debug.resolve-properties = True
debug.show-private-variables = False
debug.show-protected-variables = False
debug.show-special-variables = False
edit.qt-display-font = 'display-font-size'
edit.show-line-numbers = True
gui.auto-save-before-action = True
gui.block-comment-style = 'block-indented-pep8'
gui.display-mode = 'light'
gui.qt-display-font = 'DejaVuSansMono Nerd Font Mono,12'
gui.startup-show-wingtips = 0
guimgr.last-wingtips-size = (500,
                             425)
main.last-prefs-page = (4,
                        5)
main.last-properties-pages = {'CProjectPropertiesDialog': 0,
                              'CStartDebugProperties': 0}
main.monitor-support-upgrades = False
main.update-history = [((10,
                         0,
                         4,
                         1),
                        'https://wingware.com/pub/updates/10.0.4.1/linux-x64/cc9fb3349ce9e34663d4bd613a3be8e75a27f6a2.tar.bz2',
                        '2024-05-10 11:27:33'),
                       ((10,
                         0,
                         4,
                         2),
                        'https://wingware.com/pub/updates/10.0.4.2/linux-x64/2f572c3e86aabf36b1b46e27f9eecdda36d62d07.tar.bz2',
                        '2024-05-24 20:26:26')]

But I don't want the main.update-history info appeared there. Is this possible?

Regards, Zhao

2024-05-24 19:47:35 -0600 edited question How to disable writing main.update-history information to ~/.wingpro10/preferences?

How to disable writing main.update-history information to ~/.wingpro10/preferences? Currently, I have the following ~/.w

2024-05-24 19:47:16 -0600 edited question How to disable writing main.update-history information to ~/.wingpro10/preferences?

How to disable writing main.update-history information to ~/.wingpro10/preferences? Currently, I have the following ~/.w

2024-05-24 09:00:15 -0600 asked a question How to disable writing main.update-history information to ~/.wingpro10/preferences?

How to disable writing main.update-history information to ~/.wingpro10/preferences? Currently, I have the following ~/.w

2024-05-24 07:16:42 -0600 marked best answer Use a 3-party openai provider.

It seems that the latest Wingpro version still doesn't let me use a 3-party openai provider, say, this one.

2024-05-11 05:26:22 -0600 received badge Famous Question (source)
2024-05-11 05:20:32 -0600 received badge Popular Question (source)
2024-05-11 05:20:32 -0600 received badge Notable Question (source)
2024-05-07 08:36:07 -0600 received badge Notable Question (source)
2024-05-07 08:36:07 -0600 received badge Famous Question (source)
2024-05-07 08:36:06 -0600 received badge Famous Question (source)
2024-04-12 20:44:54 -0600 received badge Popular Question (source)
2024-04-12 20:44:54 -0600 received badge Notable Question (source)
2024-04-11 21:19:16 -0600 commented answer Use a 3-party openai provider.

See https://docs.qq.com/sheet/DUlRsc3VaZEtnUWJh?tab=BB08J2

2024-04-09 04:40:56 -0600 asked a question Use a 3-party openai provider.

Use a 3-party openai provider. It seems that the latest Wingpro version still doesn't let me use a 3-party openai provid

2024-04-05 00:30:34 -0600 received badge Notable Question (source)
2024-04-05 00:30:34 -0600 received badge Popular Question (source)
2024-03-19 08:51:50 -0600 received badge Famous Question (source)
2024-03-19 08:51:50 -0600 received badge Notable Question (source)
2024-03-19 08:51:50 -0600 received badge Popular Question (source)
2024-03-08 22:28:54 -0600 commented answer General: Unavailable Commands: debug-hide-value-tips

Very Strange. After I reboot the computer, Shift + Space can work now. I don't know why. P.S. I removed the Shift-F7 bin

2024-03-08 18:35:47 -0600 commented answer General: Unavailable Commands: debug-hide-value-tips

I have sent the bug report again.

2024-03-08 18:04:47 -0600 answered a question General: Unavailable Commands: debug-hide-value-tips

I've sent the report once more.

2024-03-08 08:49:09 -0600 commented answer General: Unavailable Commands: debug-hide-value-tips

I upgrade to the latest version now, and the problem occurs again. Furthermore, there is no Debugger > Advanced >

2024-03-08 05:43:54 -0600 commented answer General: Unavailable Commands: debug-hide-value-tips

I upgrad to the latest version now, and the problem occurs again. Furthmore, there is no Debugger > Advanced > Ani

2024-03-08 05:30:54 -0600 received badge Popular Question (source)
2024-03-06 07:20:34 -0600 marked best answer Obtain the pycharm style block comment.

In Wing, I want to obtain the pycharm style block comment, say, for the following code block snippet in a class:

def measure_strain(self) -> float:
    """Measures the average strain on bond lengths on both substructures."""
    bond_lengths = self.bond_lengths
    bottom_strain = []
    top_strain = []
    for (k1, b1) in bond_lengths.items():
        for k3, b3 in self.bbl.items():
            if (k3 == k1) or (k3[::-1] == k1):
                d = np.abs((b3 - b1)) / b1 * 100
                bottom_strain.append(d)
        for k3, b3 in self.tbl.items():
            if (k3 == k1) or (k3[::-1] == k1):
                d = np.abs((b3 - b1)) / b1 * 100
                top_strain.append(d)
    strain = np.average(bottom_strain) + np.average(top_strain)
    return strain

In wing, the result is as following with the # Indented PEP 8 Style Comment

# def measure_strain(self) -> float:
    # """Measures the average strain on bond lengths on both substructures."""
    # bond_lengths = self.bond_lengths
    # bottom_strain = []
    # top_strain = []
    # for (k1, b1) in bond_lengths.items():
        # for k3, b3 in self.bbl.items():
            # if (k3 == k1) or (k3[::-1] == k1):
                # d = np.abs((b3 - b1)) / b1 * 100
                # bottom_strain.append(d)
        # for k3, b3 in self.tbl.items():
            # if (k3 == k1) or (k3[::-1] == k1):
                # d = np.abs((b3 - b1)) / b1 * 100
                # top_strain.append(d)
    # strain = np.average(bottom_strain) + np.average(top_strain)
    # return strain

But I want to obtain the pycharm style block comment as follows:

# def measure_strain(self) -> float:
#     """Measures the average strain on bond lengths on both substructures."""
#     bond_lengths = self.bond_lengths
#     bottom_strain = []
#     top_strain = []
#     for (k1, b1) in bond_lengths.items():
#         for k3, b3 in self.bbl.items():
#             if (k3 == k1) or (k3[::-1] == k1):
#                 d = np.abs((b3 - b1)) / b1 * 100
#                 bottom_strain.append(d)
#         for k3, b3 in self.tbl.items():
#             if (k3 == k1) or (k3[::-1] == k1):
#                 d = np.abs((b3 - b1)) / b1 * 100
#                 top_strain.append(d)
#     strain = np.average(bottom_strain) + np.average(top_strain)
#     return strain
2024-03-05 18:24:35 -0600 commented question Find operation with regexp support.

No, no, I mean the general case with regexp feature, say, searching with ab.*cd.*efand so on.

2024-03-05 09:19:26 -0600 received badge Notable Question (source)