Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always overwrite eigenvalues #1419

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Always overwrite eigenvalues #1419

wants to merge 4 commits into from

Conversation

samwaseda
Copy link
Member

Problem mentioned here

@jan-janssen jan-janssen marked this pull request as draft June 11, 2024 18:45
@skatnagallu skatnagallu marked this pull request as ready for review August 21, 2024 12:44
@skatnagallu
Copy link
Contributor

Can we merge this?

@samwaseda
Copy link
Member Author

It looks like the tests had been failing but the log doesn’t get shown, so I run them again with the latest version. If the tests pass, I think we can merge it.

@samwaseda
Copy link
Member Author

It looks like depending on the source the shape of the array is not the same. Do you want to look into it? @skatnagallu

@skatnagallu
Copy link
Contributor

It looks like depending on the source the shape of the array is not the same. Do you want to look into it? @skatnagallu

yep will do

@coveralls
Copy link

coveralls commented Aug 22, 2024

Pull Request Test Coverage Report for Build 10502979427

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.005%) to 70.935%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/sphinx/base.py 2 80.13%
Totals Coverage Status
Change from base Build 10469606254: 0.005%
Covered Lines: 10680
Relevant Lines: 15056

💛 - Coveralls

@skatnagallu
Copy link
Contributor

I am not sure if the current failing Notebook has anything to do with this PR

@jan-janssen
Copy link
Member

@skatnagallu I am rather sure it has:

---------------------------------------------------------------------------
Exception encountered at "In [12]":
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[12], line 6
      4 lmp = pr.create_job(pr.job_type.Sphinx, "static")
      5 lmp.structure = pr.create_structure("Fe", "bcc", 2.55)
----> 6 lmp.run()  # The job static was saved and received the ID: 2

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_snippets/deprecate.py:158, in Deprecator.__deprecate_argument.<locals>.decorated(*args, **kwargs)
    148     if kw in self.arguments:
    149         warnings.warn(
    150             message_format.format(
    151                 "{}.{}({}={})".format(
   (...)
    156             stacklevel=2,
    157         )
--> 158 return function(*args, **kwargs)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:880, in GenericJob.run(self, delete_existing_job, repair, debug, run_mode, run_again)
    878     self._run_if_repair()
    879 elif status == "initialized":
--> 880     self._run_if_new(debug=debug)
    881 elif status == "created":
    882     self._run_if_created()

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:1395, in GenericJob._run_if_new(self, debug)
   1387 def _run_if_new(self, debug=False):
   1388     """
   1389     Internal helper function the run if new function is called when the job status is 'initialized'. It prepares
   1390     the hdf5 file and the corresponding directory structure.
   (...)
   1393         debug (bool): Debug Mode
   1394     """
-> 1395     run_job_with_status_initialized(job=self, debug=debug)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:204, in run_job_with_status_initialized(job, debug)
    196 # The PythonFunctionContainerJob can generate the job_name during job.save(). In particular, this can lead to
    197 # the job being reloaded from the database resulting in the job status to change from initialized to finished.
    198 # Skipping the job.run() prevents raising a warning by calling job.run() on an already finished job.
    199 if (
    200     not job.status.finished
    201     and not job.status.aborted
    202     and not job.status.not_converged
    203 ):
--> 204     job.run()

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_snippets/deprecate.py:158, in Deprecator.__deprecate_argument.<locals>.decorated(*args, **kwargs)
    148     if kw in self.arguments:
    149         warnings.warn(
    150             message_format.format(
    151                 "{}.{}({}={})".format(
   (...)
    156             stacklevel=2,
    157         )
--> 158 return function(*args, **kwargs)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:882, in GenericJob.run(self, delete_existing_job, repair, debug, run_mode, run_again)
    880     self._run_if_new(debug=debug)
    881 elif status == "created":
--> 882     self._run_if_created()
    883 elif status == "submitted":
    884     run_job_with_status_submitted(job=self)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:1406, in GenericJob._run_if_created(self)
   1397 def _run_if_created(self):
   1398     """
   1399     Internal helper function the run if created function is called when the job status is 'created'. It executes
   1400     the simulation, either in modal mode, meaning waiting for the simulation to finish, manually, or submits the
   (...)
   1404         int: Queue ID - if the job was send to the queue
   1405     """
-> 1406     return run_job_with_status_created(job=self)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:227, in run_job_with_status_created(job)
    225     run_job_with_runmode_manually(job=job, _manually_print=True)
    226 elif job.server.run_mode.modal:
--> 227     job.run_static()
    228 elif job.server.run_mode.srun:
    229     run_job_with_runmode_srun(job=job)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:920, in GenericJob.run_static(self)
    918     execute_job_with_calculate_function(job=self)
    919 else:
--> 920     return execute_job_with_external_executable(job=self)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:733, in run_time_decorator.<locals>.wrapper(job)
    731 if not state.database.database_is_disabled and job.job_id is not None:
    732     job.project.db.item_update({"timestart": datetime.now()}, job.job_id)
--> 733     output = func(job)
    734     job.project.db.item_update(job._runtime(), job.job_id)
    735 else:

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:832, in execute_job_with_external_executable(job)
    828 with open(
    829     posixpath.join(job.project_hdf5.working_directory, "error.out"), mode="w"
    830 ) as f_err:
    831     f_err.write(out)
--> 832 handle_finished_job(job=job, job_crashed=job_crashed, collect_output=True)
    833 return out

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:848, in handle_finished_job(job, job_crashed, collect_output)
    846 if collect_output:
    847     job.status.collect = True
--> 848     job.run()
    849 if job_crashed:
    850     job.status.aborted = True

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_snippets/deprecate.py:158, in Deprecator.__deprecate_argument.<locals>.decorated(*args, **kwargs)
    148     if kw in self.arguments:
    149         warnings.warn(
    150             message_format.format(
    151                 "{}.{}({}={})".format(
   (...)
    156             stacklevel=2,
    157         )
--> 158 return function(*args, **kwargs)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:888, in GenericJob.run(self, delete_existing_job, repair, debug, run_mode, run_again)
    886     self._run_if_running()
    887 elif status == "collect":
--> 888     self._run_if_collect()
    889 elif status == "suspend":
    890     self._run_if_suspended()

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py:1448, in GenericJob._run_if_collect(self)
   1442 def _run_if_collect(self):
   1443     """
   1444     Internal helper function the run if collect function is called when the job status is 'collect'. It collects
   1445     the simulation output using the standardized functions collect_output() and collect_logfiles(). Afterwards the
   1446     status is set to 'finished'
   1447     """
-> 1448     run_job_with_status_collect(job=self)

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pyiron_base/jobs/job/runfunction.py:345, in run_job_with_status_collect(job)
    343 job.run_time_to_db()
    344 if job.status.collect:
--> 345     if not job.convergence_check():
    346         job.status.not_converged = True
    347     else:

File ~/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/sphinx/base.py:1486, in SphinxBase.convergence_check(self)
   1477 """
   1478 Checks for electronic and ionic convergence according to the user specified tolerance
   1479 
   (...)
   1483 
   1484 """
   1485 # Checks if sufficient empty states are present
-> 1486 if not self.nbands_convergence_check():
   1487     return False
   1488 return self.output.generic.dft.scf_convergence[-1]

File ~/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/dft/job/generic.py:370, in GenericDFTJob.nbands_convergence_check(self)
    361 def nbands_convergence_check(self):
    362     """
    363     Function to check if there are a sufficient number of empty bands in the calculation to ensure electronic convergence.
    364 
   (...)
    367         bool : True if the highest band is unoccupied, False if the highest band is occupied
    368     """
    369     return np.all(
--> 370         np.isclose(self["output/electronic_structure/occ_matrix"][:, :, -1], 0)
    371     )

TypeError: 'NoneType' object is not subscriptable

@skatnagallu
Copy link
Contributor

Then I am not sure how to solve this.

@jan-janssen
Copy link
Member

@samwaseda As far as I understand this pull request is no longer necessary after we merged #1549 , correct? If that is the case please close the pull request.

@jan-janssen jan-janssen marked this pull request as draft September 6, 2024 06:19
@samwaseda
Copy link
Member Author

@samwaseda As far as I understand this pull request is no longer necessary after we merged pyiron/pyiron_base#1549 , correct? If that is the case please close the pull request.

It's true that what this was opened for got fulfilled, but the error of this PR showed another problem in the parser, so I would like to fix it before we forget about it -> leave it open for now, at least until next week

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.

4 participants