Skip to content

Conversation

@prasad-sawantdesai
Copy link
Collaborator

No description provided.

if( NOT AL_DOWNLOAD_DEPENDENCIES AND NOT AL_DEVELOPMENT_LAYOUT )
# The DD easybuild module should be loaded, use that module:
if( "$ENV{IMAS_PREFIX}" STREQUAL "" OR "$ENV{IMAS_VERSION}" STREQUAL "" )
if( "$ENV{IMAS_PREFIX}" STREQUAL "" )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is setting IMAS_PREFIX and to what? Is this only for old legacy versions of DD? (legacy AL more or less corresponds to dev-layout with all interfaces next to each others, so this may not be relevant, cf. installer/cmake branch maybe).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we also need to change below instances..

$ grep -R  "IMAS_PREFIX" . 
./models/mdsplus/alport/alport.py:  xml.sax.parse(os.environ['IMAS_PREFIX']+'/models/mdsplus/alport/ids.xml', h)  
./models/mdsplus/alport/alport.py:  command = os.environ['IMAS_PREFIX']+'/models/mdsplus/alport/convert_aos '+str(inPulse) + '  '+ str(inName)[10:] + '  '+str(outPulse)+'  '+str(outName)[10:]
./models/mdsplus/alport/alport.py:          command = os.environ['IMAS_PREFIX']+'/models/mdsplus/alport/convert_aos '+str(inPulse) + '  '+ inName[10:]+':TIMED0' + '  '+str(outPulse)+'  '+outName[10:]
./models/mdsplus/alport/alport.py:    os.system('cp -f '+os.environ['IMAS_PREFIX']+'/models/mdsplus/ids_model.* .')
./common/cmake/ALBuildDataDictionary.cmake:  if( "$ENV{IMAS_PREFIX}" STREQUAL "" )
./common/cmake/ALBuildDataDictionary.cmake:      "Environment variable IMAS_PREFIX ('$ENV{IMAS_PREFIX}') not set."
./common/cmake/ALBuildDataDictionary.cmake:  set( IDSDEF "$ENV{IMAS_PREFIX}/include/IDSDef.xml" )
./src/uda/uda_xml.cpp:        env = getenv("IMAS_PREFIX");
./src/uda/uda_xml.cpp:            throw std::runtime_error("neither IMAS_PREFIX or IDSDEF_PATH environmental variable is set");
./src/uda/uda_xml.cpp:        throw std::runtime_error("IDSDef.xml not found at either $IDSDEF_PATH or $IMAS_PREFIX/include/IDSDef.xml");
./src/uda/uda_xml.hpp: * The path of the file is given by the IDSDEF_PATH environmental variable, or constructed from the IMAS_PREFIX
./src/uda/uda_xml.hpp: *  `$IMAS_PREFIX/include/IDSDef.xml`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • alport.py: no need to change, it can probably be removed altogether, IIRC this was a specific conversion script for AL3 to AL4, so it's ancient archeology
  • uda_xml: here IMAS_PREFIX is one option, the other one being IDSDEF_PATH, if the later is set, it will work (and it does not assume a file name for this XML)
  • in the cmake, we can keep the part if that allow to build with older DD?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified with 3.39.0 `

$ pip install imas-data-dictionary==3.39.0
$ cmake AL_PYTHON_BINDINGS=no-build-isolation -DCMAKE_INSTALL_PREFIX="$(pwd)/test-install/" -S . -B build
...
-- Detected DD 3.x/4.0.0 layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/dd_3.39.0/include/core_instant_changes/core_instant_changes_identifier.xml;...
$ pip install imas-data-dictionary==3.42.2
$ cmake -D AL_PYTHON_BINDINGS=no-build-isolation -DCMAKE_INSTALL_PREFIX="$(pwd)/test-install/" -S . -B build
...
-- Detected DD 3.x/4.0.0 layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/dd_3.42.2/include/core_instant_changes/core_instant_changes_identifier.xml;...
$ pip install imas-data-dictionary==4.1.0
...
-- Detected DD 4.1.0+ layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/lib/python3.11/site-packages/imas_data_dictionary/resources/schemas/balance_of_plant/power_cycle_identifier.xml;...

```

@olivhoenen
Copy link
Collaborator

After checking imas-data-dictionary versions available on PyPI, I see that we have 3.39 also (IIRC as a patched version with idsinfo and not idsdef command), so we can probably full rely on this and get rid of IMAS_PREFIX everywhere (depending on the test from @dee-mew )

@prasad-sawantdesai
Copy link
Collaborator Author

After checking imas-data-dictionary versions available on PyPI, I see that we have 3.39 also (IIRC as a patched version with idsinfo and not idsdef command), so we can probably full rely on this and get rid of IMAS_PREFIX everywhere (depending on the test from @dee-mew )

Checked these DD versions. it can find identifiers..

$ pip install imas-data-dictionary==3.39.0
$ cmake AL_PYTHON_BINDINGS=no-build-isolation -DCMAKE_INSTALL_PREFIX="$(pwd)/test-install/" -S . -B build
...
-- Detected DD 3.x/4.0.0 layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/dd_3.39.0/include/core_instant_changes/core_instant_changes_identifier.xml;...
$ pip install imas-data-dictionary==3.42.2
$ cmake -D AL_PYTHON_BINDINGS=no-build-isolation -DCMAKE_INSTALL_PREFIX="$(pwd)/test-install/" -S . -B build
...
-- Detected DD 3.x/4.0.0 layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/dd_3.42.2/include/core_instant_changes/core_instant_changes_identifier.xml;...
$ pip install imas-data-dictionary==4.1.0
...
-- Detected DD 4.1.0+ layout
-- Found /home/ITER/sawantp1/github/IMAS-Core2/myenv/lib/python3.11/site-packages/imas_data_dictionary/resources/schemas/balance_of_plant/power_cycle_identifier.xml;...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants