ExoPlex
ExoPlex copied to clipboard
Pexpect Error
When running the file "example_by_mass.py" an error is thrown regarding pexpect.
` (base) C:\Users<username>\Downloads\ExoPlex_dist\ExoPlex_dist\Examples>python example_by_mass.py
Core composition: {'Fe': 100.0, 'Si': 0.0, 'O': 0.0, 'S': 0.0} Mantle composition: {'FeO': 0.0, 'SiO2': 52.55497015, 'MgO': 39.17101638, 'CaO': 3.81493827, 'Al2O3': 4.45907521} Mantle Fe# -0.0 Core Mass Percent = 32.816
Your closest grid filename is: 0.07CaMg_0.00FeMg_0.09AlMg_0.9SiMg_0.0NaMg_0.00Fe_U/LM_results.txt
Core composition: {'Fe': 100.0, 'Si': 0.0, 'O': 0.0, 'S': 0.0} Mantle composition: {'FeO': 0.0, 'SiO2': 52.55497015, 'MgO': 39.17101638, 'CaO': 3.81493827, 'Al2O3': 4.45907521} Mantle Fe# -0.0 Core Mass Percent = 32.816
Making upper mantle PerPlex phase file.
This will be stored in: ../Calc_Solutions/0.07CaMg_0.00FeMg_0.09AlMg_0.9SiMg_0.0NaMg_0.00Fe_UM_results.txt
Traceback (most recent call last):
File "C:\Users\jkingsbury\Downloads\ExoPlex_dist\ExoPlex_dist\Examples\example_by_mass.py", line 95, in
On two Windows computers using Anaconda (with python 3.9.7, pexpect version 4.8.0, and the latest ExoPlex version), the example file works on one machine and not on the other. The error is also thrown on another computer using pexpect 4.6.0 and upgrading pexpect to 4.8.0 didn't correct the issue.
In the pexpect documentation, it states pexpect.spawn doesn't work on Windows. https://pexpect.readthedocs.io/en/stable/install.html#requirements
Even more confusing, the newest version works on my Windows machine, but using an older version of ExoPlex in another directory but the same terminal fails with the error above. Switching directories back to the newer ExoPlex immediately after works on my machine. However both new and old versions throw the above error on other Windows machines. I haven't been able to figure out what the differentiating factor is here.
I also have an instance of this issue on a Linux machine, I can provide more info if needed.
I figured out pexpect in run_perplex.py also fails in the working setups, but the code returns before it gets to fail.
I haven't gotten far enough to understand why between two freshly unzipped directories of ExoPlex, one might return before point-of-failure and complete successfully while the other fails to return and hits the point of failure.
Interesting! I don't have a windows machine so I was never able to test any of the code out on that platform. I'll add a note to the code description stating that.
Although I will say this should only affect things if you want to run PerPlex for a composition outside of the grids (or need a very specific one). If you set use_grids = True, then it should bypass pexpect altogether.
Hi @joshuaekingsbury, was this ever solved? I'm debating making a windows version once I get access to a machine regularly.
Hello @CaymanUnterborn, the problem eventually seemed to stem from the Solutions_Small files missing from the directory after downloading and extracting. I'm not sure if the files were missing from the code .zip download for some reason or were not properly extracted. Replacing the Solutions_Small directory/files solved the issue if I remember correctly. I no longer have the laptop I was using at the time and so unfortunately cannot check. Once the school year begins I'll try to check with the peers I was helping troubleshoot at the time.
While the pexpect error was thrown on Windows machines when the files were missing, the issue of missing files did not seem to be platform specific.