Skip to content

Commit

Permalink
Apm nomad fixes (#11)
Browse files Browse the repository at this point in the history
* Removed redundant writing of the NeXus definition and its version

* Removed obsolete version writing

---------

Co-authored-by: mkuehbach <[email protected]>
  • Loading branch information
mkuehbach and atomprobe-tc authored May 15, 2024
1 parent 3387238 commit 2366b6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
4 changes: 0 additions & 4 deletions pynxtools_apm/config/oasis_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@

import datetime as dt

from pynxtools_apm.utils.versioning import NX_APM_ADEF_NAME


APM_OASISCONFIG_TO_NEXUS = {
"prefix_trg": "/ENTRY[entry*]",
"use": [
("definition", f"{NX_APM_ADEF_NAME}"),
(
"start_time",
f"{dt.datetime.now(dt.timezone.utc).isoformat().replace('+00:00', 'Z')}",
Expand Down
28 changes: 10 additions & 18 deletions pynxtools_apm/utils/generate_synthetic_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,34 @@
# MK::2023/05/04 the code in this file can currently not be used when
# developers have an environment which uses ase==3.19.0 and numpy>=1.2x

import hashlib

import datetime

import hashlib
from typing import List

import numpy as np

import ase
import numpy as np
from ase.data import atomic_masses, atomic_numbers, chemical_symbols
from ase.lattice.cubic import FaceCenteredCubic
from ase.data import atomic_numbers, atomic_masses, chemical_symbols

from ifes_apt_tc_data_modeling.utils.utils import (
create_nuclide_hash,
nuclide_hash_to_nuclide_list,
nuclide_hash_to_human_readable_name,
MAX_NUMBER_OF_ATOMS_PER_ION,
MQ_EPSILON,
create_nuclide_hash,
nuclide_hash_to_human_readable_name,
nuclide_hash_to_nuclide_list,
)

from pynxtools_apm.utils.load_ranging import (
add_unknown_iontype,
)

# do not use ase directly any longer for NIST isotopes, instead this syntatic equivalent
# from ifes_apt_tc_data_modeling.utils.nist_isotope_data \
# import isotopes

from pynxtools_apm.utils.versioning import (
NX_APM_ADEF_NAME,
NX_APM_EXEC_NAME,
NX_APM_EXEC_VERSION,
)

from pynxtools_apm.utils.load_ranging import (
add_unknown_iontype,
)


# parameter affecting reconstructed positions and size
CRYSTAL_ORIENTATION = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
# MK::add analysis how large aggregate has to be
Expand Down Expand Up @@ -313,7 +306,6 @@ def emulate_entry(self, template: dict) -> dict:
# check if required fields exists and are valid
# print("Parsing entry...")
trg = f"/ENTRY[entry{self.entry_id}]/"
template[f"{trg}definition"] = NX_APM_ADEF_NAME
template[f"{trg}programID[program1]/program"] = NX_APM_EXEC_NAME
template[f"{trg}programID[program1]/program/@version"] = NX_APM_EXEC_VERSION
template[f"{trg}start_time"] = datetime.datetime.now().astimezone().isoformat()
Expand Down
5 changes: 1 addition & 4 deletions pynxtools_apm/utils/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from pynxtools_apm.utils.get_gitrepo_commit import get_repo_last_commit


NX_APM_ADEF_NAME = "NXapm"
NX_APM_EXEC_NAME = "pynxtools-apm/reader.py"


def get_apm_exec_version() -> str:
tag = get_repo_last_commit()
if tag is not None:
Expand All @@ -34,6 +30,7 @@ def get_apm_exec_version() -> str:
)


NX_APM_EXEC_NAME = "pynxtools-apm/reader.py"
NX_APM_EXEC_VERSION = get_apm_exec_version()

# numerics
Expand Down

0 comments on commit 2366b6f

Please sign in to comment.