-
Notifications
You must be signed in to change notification settings - Fork 1
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
restructure scienta-PEAK-ibw update #111
base: scienta-PEAK-ibw
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request restructures the Scienta PEAK IBW update by refactoring parser logic, updating data mapping and unit handling, and introducing JSON schema validation for PEAK metadata. Major changes include reorganizing parser classes into abstract and version-specific implementations, refactoring how raw spectrum data is processed and flattened, and streamlining unit mappings across the project. Updated class diagram for Scienta Parser refactoringclassDiagram
%% Base mapping class
class XPSMapper {
<<abstract>>
}
%% MapperScienta inherits from XPSMapper and uses parser logic
class MapperScienta {
- _xps_dict : dict
+ construct_data()
+ _select_parser()
+ _update_xps_dict_with_spectrum(spectrum: Dict)
}
XPSMapper <|-- MapperScienta
%% Abstract parser class
class ScientaIgorParser {
<<abstract>>
+ parse_file(file: Union[str, Path])
+ _parse_unit(bunit: bytes) : List[Tuple[str, Optional[str]]]
+ axis_for_dim(wave_header: Dict, dim: int) : np.ndarray
+ axis_units_for_dim(wave_header: Dict, dim: int) : str
# _parse_note(bnote: bytes) : Dict
# _parse_region_metadata(region_id: int, notes: Dict) : Dict
}
%% Parser implementation for old data export
class ScientaIgorParserOld {
+ _parse_note(bnote: bytes) : Dict
+ _parse_region_metadata(region_id: int, notes: Dict) : Dict
}
ScientaIgorParser <|-- ScientaIgorParserOld
%% Parser implementation for PEAK software export
class ScientaIgorParserPEAK {
+ _parse_note(bnote: bytes) : Dict
+ _parse_region_metadata(region_id: int, notes: Dict) : Dict
}
ScientaIgorParser <|-- ScientaIgorParserPEAK
%% Utility function as a helper (not a class but represented for clarity)
class flatten_dict {
<<utility>>
+ flatten_dict(d: Dict, parent_key: str, sep: str) : Dict
}
%% Relationships
MapperScienta ..> ScientaIgorParser : uses
MapperScienta ..> flatten_dict : calls
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by Sourcery
Update the Scienta parser to support newer .ibw files and improve data handling. Flatten nested dictionaries within the metadata for easier access. Standardize energy scales and units. Add support for exporting axes data for plotting. Update example data and identifiers.