@@ -1646,6 +1646,11 @@ namespace BasisClasses
16461646 // Sanity: check that the DiskType attribute exists
16471647 //
16481648 if (!file.hasAttribute (" DiskType" )) {
1649+ // If the DiskType attribute is missing, this may indicate
1650+ // an old cache file created before the DiskType metadata
1651+ // was added. We will continue with a warning, but trigger
1652+ // cache recomputation to ensure consistency with the
1653+ // current DiskType.
16491654 if (myid==0 ) {
16501655 std::cout << " ---- Cylindrical: DiskType attribute not found in cache file <" << cachename << " >. " << std::endl
16511656 << " ---- This may indicate an old cache file created before DiskType metadata was added. " << std::endl
@@ -1676,10 +1681,17 @@ namespace BasisClasses
16761681 }
16771682 else if (disktype == DiskType::python) {
16781683
1684+ // If the DiskType is python, we also need to check that
1685+ // the Python module used to create the cache matches the
1686+ // current Python module to ensure consistency. This tag
1687+ // should be present in the cache if it was created with a
1688+ // recent version of the code, but if it is missing we
1689+ // will trigger cache recomputation to ensure consistency
1690+ // with the current Python module.
16791691 if (file.hasAttribute (" pythonDiskType" ) == false ) {
16801692 if (myid==0 ) {
16811693 std::cout << " ---- Cylindrical: pythonDiskType attribute not found in cache file <" << cachename << " >. " << std::endl;
1682- std::cout << " ---- This may indicate an old cache file created before pythonDiskType metadata was added. " << std::endl;
1694+ std::cout << " ---- Cylindrical: this may be a logic error, trigger recomputation. " << std::endl;
16831695 }
16841696 cache_status = 0 ;
16851697 } else {
@@ -1718,9 +1730,13 @@ namespace BasisClasses
17181730 // Get the deproject attribute
17191731 //
17201732 if (!file.hasAttribute (" deproject" )) {
1733+ // We should not be able to get here since the deproject
1734+ // attribute is required for cache creation, but if it is
1735+ // missing we will trigger cache recomputation to ensure
1736+ // consistency.
17211737 if (myid==0 ) {
17221738 std::cout << " ---- Cylindrical: deproject attribute not found in cache file <" << cachename << " >. " << std::endl;
1723- std::cout << " ---- This may indicate an old cache file created before deproject metadata was added. " << std::endl;
1739+ std::cout << " ---- Cylindrical: this may be a logic error, trigger recomputation. " << std::endl;
17241740 }
17251741 cache_status = 0 ;
17261742 } else {
@@ -1767,9 +1783,11 @@ namespace BasisClasses
17671783 // Get the Python info
17681784 //
17691785 if (!file.hasAttribute (" pythonProjType" )) {
1786+ // We should not be able to get here since the pythonProjType
1787+ // attribute is required for cache creation with the Python
17701788 if (myid==0 ) {
17711789 std::cout << " ---- Cylindrical: pythonProjType attribute not found in cache file <" << cachename << " >. " << std::endl;
1772- std::cout << " ---- This may indicate an old cache file created before pythonProjType metadata was added. " << std::endl;
1790+ std::cout << " ---- Cylindrical: this may be a logic error, trigger recomputation. " << std::endl;
17731791 }
17741792
17751793 cache_status = 0 ;
0 commit comments