Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 25 05:01
    richardotis synchronize #260
  • Jan 25 05:01

    richardotis on quasichemical

    ENH: cs_dat: Some magnetic terms (compare)

  • Jan 25 01:27
    richardotis synchronize #260
  • Jan 25 01:27

    richardotis on quasichemical

    WIP: io.cs_dat: ChemSage DAT fi… FIX: grammar: floating-point nu… ENH/WIP: cs_dat: Stoichiometric… (compare)

  • Jan 22 14:53
    bocklund commented #258
  • Jan 21 21:28
    bocklund closed #255
  • Jan 21 21:28
    bocklund commented #255
  • Jan 18 15:32
    bocklund opened #261
  • Jan 17 00:08
    richardotis edited #260
  • Jan 17 00:03
    richardotis labeled #260
  • Jan 17 00:03
    richardotis opened #260
  • Jan 16 23:25

    richardotis on quasichemical

    ENH: Model/tdb: Preserve order … (compare)

  • Jan 16 22:45

    richardotis on quasichemical

    FIX: Model: Use defaultdict to … TST: test_binary_quasichemical:… (compare)

  • Jan 16 16:28
    bocklund opened #259
  • Jan 16 00:01

    richardotis on quasichemical

    ENH/WIP: tdb: Support for chang… ENH/WIP: Model: Pull desired bi… WIP/ENH: Model: POLYNOM binary … (compare)

  • Jan 15 18:05

    richardotis on quasichemical

    WIP/ENH: Model: Quasichemical 0… ENH/WIP: Model: Quasichemical b… (compare)

  • Jan 15 00:59

    richardotis on quasichemical

    ENH/WIP: Model: Pairwise quasic… (compare)

  • Jan 13 23:57

    richardotis on quasichemical

    ENH/WIP: tdb: First pass at TDB… (compare)

  • Dec 31 2019 17:20
    igorjrd synchronize #258
  • Dec 30 2019 22:25
    richardotis commented #254
Richard Otis
@richardotis
Hi @igorjrd - when you go to the main pycalphad source directory and run python setup.py develop, what happens?
Igor J Marques
@igorjrd
running develop
running egg_info
writing pycalphad.egg-info/PKG-INFO
writing dependency_links to pycalphad.egg-info/dependency_links.txt
writing requirements to pycalphad.egg-info/requires.txt
writing top-level names to pycalphad.egg-info/top_level.txt
reading manifest file 'pycalphad.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pycalphad.egg-info/SOURCES.txt'
running build_ext
building 'pycalphad.core.hyperplane' extension
gcc -pthread -B /home/igor/miniconda3/envs/pycalphad-dev/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include -I/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/symengine/lib -I/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include -I/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/symengine/lib -I/home/igor/miniconda3/envs/pycalphad-dev/include -I/home/igor/miniconda3/envs/pycalphad-dev/include/python3.7m -I/home/igor/miniconda3/envs/pycalphad-dev/include/python3.7m -c pycalphad/core/hyperplane.cpp -o build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o -std=c++11 -D_hypot=hypot
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,
                 from /home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from pycalphad/core/hyperplane.cpp:648:
/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^~~~~~~
pycalphad/core/hyperplane.cpp:2804:13: warning: ‘void __pyx_f_9pycalphad_4core_10hyperplane_prodsum(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)’ defined but not used [-Wunused-function]
 static void __pyx_f_9pycalphad_4core_10hyperplane_prodsum(__Pyx_memviewslice __pyx_v_chempots, __Pyx_memviewslice __pyx_v_points, __Pyx_memviewslice __pyx_v_result) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++ -pthread -shared -B /home/igor/miniconda3/envs/pycalphad-dev/compiler_compat -L/home/igor/miniconda3/envs/pycalphad-dev/lib -Wl,-rpath=/home/igor/miniconda3/envs/pycalphad-dev/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o -L/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/symengine/lib -L/home/igor/miniconda3/envs/pycalphad-dev/lib/python3.7/site-packages/symengine/bin -lsymengine -o build/lib.linux-x86_64-3.7/pycalphad/core/hyperplane.cpython-37m-x86_64-linux-gnu.so -std=c++11
/home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld: build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o: unable to initialize decompress status for section .debug_info
/home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld: build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o: unable to initialize decompress status for section .debug_info
/home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld: build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o: unable to initialize decompress status for section .debug_info
/home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld: build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o: unable to initialize decompress status for section .debug_info
build/temp.linux-x86_64-3.7/pycalphad/core/hyperplane.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Richard Otis
@richardotis
I think what's happening is there are some old compiled modules which are confusing the compiler
Try rm -R build and rm pycalphad/core/*.o && rm pycalphad/core/*.so
Then run python setup.py develop again
Also what is the output of git status
You want to be on the branch called "develop"
Igor J Marques
@igorjrd
When i try rm pycalphad/core/*.o && rm pycalphad/core/*.so the system returns rm: "is not possible to remove 'pycalphad/core/*.o': file or directory does not exhist" (something like this, my OS language is not setted as english)
about git status, its OK
On branch develop
Your branch is up to date with 'origin/develop'.
Richard Otis
@richardotis
Clearing out the build directory should be sufficient
Try running python setup.py develop
Igor J Marques
@igorjrd
The same error persists. I checked the core folder and there is not any .o or .so files
Richard Otis
@richardotis
ok, I think you are running into this upstream issue ContinuumIO/anaconda-issues#11152
The short-term solution is to try running mv /home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld /home/igor/miniconda3/envs/pycalphad-dev/compiler_compat/ld_old
Then python setup.py clean and python setup.py develop
Igor J Marques
@igorjrd
Its working now! My sincerely thanks @richardotis and @bocklund!
I was thinking to try to solve, the issue pycalphad/pycalphad#191. Is this issue currently unfixed?
Richard Otis
@richardotis
Yes, it is still unfixed and no one else is working on it as far as we know
Daniel Schwen
@dschwen
It look like pycalphad can currently not deal with MatCalc TDB files (https://www.matcalc.at/images/stories/Download/Database/mc_fe_v2.059.tdb for example). There are some easily fixable unicode issues in the reference section of the file, but after fixing those pycalphad runs into a bunch of parse errors.
The most obvious ones are MatCalc-specific commands like "REFERENCE ELEMENT"
But commenting those out will make it choke on
Failed while parsing: PARAMETER HMVA(FCC_A1,*;0) 273.00 +175000; 6000.00 N REF:pov12
Has anyone tried to work around this yet? The open MatCalc TDB files cove a lot of ground that I'm unable to fin using TDBDB
(in case anyone does not know that site, it is a search engine for freely available TDB files: https://avdwgroup.engin.brown.edu/)
Richard Otis
@richardotis
@dschwen https://groups.google.com/forum/#!topic/pycalphad/c8LJV-8JFkc A user manually edited that file last year to make it pycalphad-compatible
I've used it for example calculations a few times but we haven't verified the database's accuracy, or even if pycalphad and MatCalc are getting the same answer consistently
jayagreav
@jayagreav
Hi! I created a tdb file, named 'alcr' from COST 507 database and tried to run it on Scheil-Gulliver simulation tool from pycalphad.

$
ELEMENT /- ELECTRON_GAS 0.0000E+00 0.0000E+00 0.0000E+00!
ELEMENT VA VACUUM 0.0000E+00 0.0000E+00 0.0000E+00!
ELEMENT AL FCC_A1 26.981539 4577.296 28.3215!
ELEMENT CR BCC_A2 55.847 4050 23.56 !

$
$--------1---------2---------3---------4---------5---------6---------7---------8
$
FUNCTION UN_ASS 298.15 0; 300.00 N !
FUNCTION GHSERAL 298.15 -7976.15+137.093038T-24.3671976TLN(T)
-.001884662
T2-8.77664E-07*T3+74092T**(-1); 700 Y
-11276.24+223.048446
T-38.5844296TLN(T)+.018531982T**2
-5.764227E-06
T3+74092*T(-1); 933.47 Y
-11278.378+188.684153T-31.748192TLN(T)-1.230524E+28T**(-9); 2900 N !

FUNCTION GHSERCR 298.15
-8856.94+157.48T-26.908TLN(T)+1.89435E-3T2
-1.47721E-6*T
3+139250T**(-1); 2180 Y
-34869.344+344.18
T-50TLN(T)-2885.26E29T*(-9); 6000 N !

FUNCTION GALBCC 298.15 +10083-4.813T+GHSERAL#; 6000 N !
FUNCTION GBCCAL 298.15 +10083-4.813
T+GHSERAL#; 6000 N !
FUNCTION GALLIQ 298.15 +11005.029-11.841867T+7.934E-20T7
+GHSERAL#; 933.47 Y
+10482.382-11.253974T+1.231E+28T
(-9)+GHSERAL#; 2900 N !
FUNCTION GCRFCC 298.15 -7284.0+0.163T+GHSERCR#; 6000 N !
FUNCTION GCRLIQ 298.15 +24339.955-11.420225
T
+2.37615E-21T**7+GHSERCR#; 2180 Y
18409.36-8.563683
T
+2.88526E+32T*(-9)+GHSERCR#; 6000 N !

$
TYPE_DEFINITION % SEQ *!
DEFINE_SYSTEM_DEFAULT ELEMENT 2 !
DEFAULT_COMMAND DEF_SYS_ELEMENT VA !
$
PHASE LIQUID % 1 1.0 !
CONSTITUENT LIQUID :AL,CR: !
PARAMETER G(LIQUID, AL, 0) 298.15 +GALLIQ#; 6000 N !
PARAMETER G(LIQUID, CR, 0) 298.15 +GCRLIQ#; 6000 N !
PARAMETER G(LIQUID, AL, CR; 0) 298.15 -29000.0; 6000 N !
PARAMETER G(LIQUID, AL, CR; 1) 298.15 -11000.0; 6000 N !

TYPE_DEFINITION / GES A_P_D FCC_A1 MAGNETIC -3.0 2.80000E-01 !
PHASE FCC_A1 %/ 2 1 1 !
CONSTITUENT FCC_A1 :AL,CR: !
PARAMETER G(FCC_A1, AL, 0) 298.15 +GHSERAL#; 2900 N !
PARAMETER G(FCC_A1, CR, 0) 298.15 +GCRFCC#; 6000 N !
PARAMETER G(FCC_A1,AL,CR:VA;0) 298.15 -45900+6.0*T; 6000 N !

TYPE_DEFINITION & GES A_P_D B2_BCC DIS_PART BCC_A2 ,,,!
TYPE_DEFINITION - GES A_P_D BCC_A2 MAGNETIC -1.0 0.4 !
PHASE BCC_A2 &%- 1 1.0 !
CONSTITUENT BCC_A2 :AL,CR: !
PARAMETER G(BCC_A2, AL, 0) 298.15 +GHSERCR#; 2900 N !
PARAMETER G(BCC_A2, CR, 0) 298.15 +GBCCAL#; 6000 N !
PARAMETER G(BCC_A2,AL,CR:VA;0) 298.15 -54900+10*T; 6000 N !

PHASE ALCR2 % 2 1 2 !
CONSTITUENT ALCR2 : AL : CR : !
PARAMETER G(ALCR2,AL:CR;0) 298.15 -32700.0-8.79T
+GHSERAL#+2.0
GHSERCR#; 6000 N !

PHASE AL4CR % 2 4 1 !
CONSTITUENT AL4CR : AL : CR : !
PARAMETER G(AL4CR,AL:CR;0) 298.15 -89025.0+19.05T
+4.0
GHSERAL#+GHSERCR#; 6000 N !

PHASE AL8CR5_H % 2 8 5 !
CONSTITUENT AL : CR : !
PARAMETER G(AL8CR5_H,AL:CR;0) 298.15 -147732.0-58.5T
+8.0
GHSERAL+5.0*GHSERCR; 6000 N !

PHASE AL8CR5_L % 2 8 5 !
CONSTITUENT AL : CR : !
PARAMETER G(AL8CR5_L,AL:CR;0) 298.15 -229515.0
+8.0GHSERAL#+5.0GHSERCR#; 6000 N !

PHASE AL9CR4_L % 2 9 4 !
CONSTITUENT AL : CR : !
PARAMETER G(AL9CR4_L,AL:CR;0) 298.15 -230750.0+16.094T
+9.0
GHSERAL#+4.0*GHSERCR#; 6000 N !

PHASE AL9CR4_H % 2 9 4 !
CONSTITUENT AL : CR : !
PARAMETER G(AL9CR4_H,AL:CR;0) 298.15 -134433.0-56.16T
+9.0
GHSERAL#+4.0*GHSERCR#; 6000 N !

PHASE AL11CR2 % 3 10 1 2 !
CONSTITUENT AL : AL : CR : !
PARAMETER G(AL11CR2,AL:AL:CR;0) 298.15 -175500.0+25.805T
+11.0
GHSERAL#+2.0*GHSERC

but I got Keyerror 'AL' from Spyder. How to fix it?
jayagreav
@jayagreav

import matplotlib.pyplot as plt
from pycalphad import Database, variables as v
from scheil import simulate_scheil_solidification

setup the simulation parameters

dbf = Database('alcr.tdb')
comps = ['AL', 'CR', 'VA']
phases = sorted(dbf.phases.keys())

liquid_phase_name = 'LIQUID'
initial_composition = {v.X('CR'): 0.3}
start_temperature = 850

perform the simulation

sol_res = simulate_scheil_solidification(dbf, comps, phases, initial_composition, start_temperature, step_temperature=1.0)

plot the result

for phase_name, amounts in sol_res.phase_amounts.items():
plt.plot(sol_res.temperatures, amounts, label=phase_name)
plt.plot(sol_res.temperatures, sol_res.fraction_liquid, label='LIQUID')
plt.ylabel('Phase Fraction')
plt.xlabel('Temperature (K)')
plt.title('Al-30Cr Scheil simulation, phase fractions')
plt.legend(loc='best')
plt.show()

Brandon Bocklund
@bocklund
Can you share the full error? Note that you can wrap your code in 3 backticks (```) before and after the code and get nice code formatting:
print(“hello world”)
Daniel Schwen
@dschwen
Thanks, @richardotis, I got the steel_database_fix.tdb from the thread you pointed me to and it parses fine!
Brandon Bocklund
@bocklund

I'm trying to install a development version of pycalphad on a new system. I followed the typical instructions on pycalphad.org (conda install -> force remove pycalphad -> pip install pycalphad as editable). Everything compiled correctly (e.g. python setup.py build_ext --inplace works), but whenever I try to import pycalphad, I get the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/gibbs/s0/bjb54/projects/pycalphad/pycalphad/__init__.py", line 18, in <module>
    from pycalphad.core.calculate import calculate
  File "/gibbs/s0/bjb54/projects/pycalphad/pycalphad/core/calculate.py", line 7, in <module>
    from pycalphad.codegen.callables import build_phase_records
  File "/gibbs/s0/bjb54/projects/pycalphad/pycalphad/codegen/callables.py", line 5, in <module>
    from pycalphad.core.phase_rec import PhaseRecord
ImportError: /gibbs/s0/bjb54/projects/pycalphad/pycalphad/core/phase_rec.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN9SymEngine11LLVMVisitor5loadsERKSs

I think I found the symbol that's supposed to be loaded in /home/graduate/bjb54/work/software/anaconda3/envs/calphad-dev/lib/python3.6/site-packages/symengine/lib/, but the symbol is slightly different: (here's the output from readelf -Ws /home/graduate/bjb54/work/software/anaconda3/envs/calphad-dev/lib/python3.6/site-packages/symengine/lib/symengine_wrapper.cpython-36m-x86_64-linux-gnu.so | grep loadsER )

   468: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN9SymEngine11LLVMVisitor5loadsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
  8400: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN9SymEngine11LLVMVisitor5loadsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Interestingly, I grepped my phase_rec.so for ERKS and only found the following symbols

    30: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN9SymEngine11LLVMVisitor5loadsERKSs
   137: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZNSs6assignERKSs@GLIBCXX_3.4 (2)
   727: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN9SymEngine11LLVMVisitor5loadsERKSs
   898: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZNSs6assignERKSs@@GLIBCXX_3.4

while OTOH, grepping for ERKNS in my phase_rec.so gives many results (256) similar to:

   363: 0000000000032810     5 FUNC    WEAK   DEFAULT   12 _ZN9SymEngine11BaseVisitorINS_11LLVMVisitorENS_7VisitorEE5visitERKNS_4BetaE
   364: 0000000000032680     5 FUNC    WEAK   DEFAULT   12 _ZN9SymEngine11BaseVisitorINS_11LLVMVisitorENS_7VisitorEE5visitERKNS_5ATan2E

I'm not sure if there's any meaning to the mangled names, but I can't seem to track down how to correctly link to symengine

Brandon Bocklund
@bocklund
I think this was an issue with compiler incompatibility. symengine and other libs are built using conda-forge's compilers, while I was using my system gcc. conda install -c conda-forge c-compiler cxx-compiler so I was using the same compilers as used by conda-forge seemed to solve my issue. After cleaning up the pycalphad shared object build directory and recompiling with these new compilers, things are working now.
Richard Otis
@richardotis
Great advice. This should be incorporated into the install instructions for the development version.
Igor J Marques
@igorjrd
@richardotis i saw your change request on pycalphad/pycalphad#239
I have no experience at adding tests cases. Adding the case to test_model.py its sufficient to enable the test case? How can i assert that the DofError was raised?
Brandon Bocklund
@bocklund
@igorjrd yep! We use pytest for testing. Just add a function that starts with test_ is all you need to do for it to be enabled and run. You can see some documentation from pytest on how to write tests that assert errors here. Here's an example in the pycalphad code for a Database test that raises the error
Richard Otis
@richardotis
@igorjrd You're asking all the right questions!
Igor J Marques
@igorjrd
thanks @richardotis!!
Igor J Marques
@igorjrd
I wrote the test case and it worked well at my system. I just submmited a new commit at my pull request, now i think that the work is done!
Richard Otis
@richardotis
Looks good, I approved the changes, just need the tests to pass and we can merge
Igor J Marques
@igorjrd
I think that the tests won't pass at all... The travis keeps giving an error during the requirement installation of OSX Python 3.6 test
Richard Otis
@richardotis
That's ok, we can ignore that
It's a separate issue
Richard Otis
@richardotis
@igorjrd Thanks for contributing to pycalphad!
Igor J Marques
@igorjrd
You're welcome, @richardotis! I really appreciate the efforts from you and Brandon to develop pycalphad. Actually, now I am thinking about try to conclude the fixing of issue pycalphad/pycalphad#97, if you think that would be helpful. Seems like a considerable advance was developed at the cited issue, but the last steps weren't made
Richard Otis
@richardotis
Sure, I think that's a good direction to go.
Richard Otis
@richardotis
Anybody working on any of the subsystems in Li-Al-Ti-O-P? I am interested in building a database potentially.
Lei Zhang
@sjtuzhanglei_twitter
Hi, I am wondering about the directory of examples folder after installation, I am trying to play with them using pycalphad.
Brandon Bocklund
@bocklund
Hi @sjtuzhanglei_twitter, you can download the entire pycalphad repo, including the examples from GitHub (see green clone/download link) on the right hand side of the screen, a little down the page. Here's a direct link to the zip archive as well: https://github.com/pycalphad/pycalphad/archive/develop.zip
Lei Zhang
@sjtuzhanglei_twitter
Thank you, Brandon!