83 clear up classes in sample#87
Conversation
…syScience/EasyReflectometryLib into 83-clear-up-classes-in-sample
rozyczko
left a comment
There was a problem hiding this comment.
Small comment on naming consistency.
module surfactant_layer contains class SurfactantLayer.
module gradient_layer contains class GradientLayer
so it is sensible to assume that PascalCase for classes converts into snake_case for modules.
This doesn't seem to hold for MultiLayer class which module you named multilayer.
Is there any reason or should the class name be just Multilayer (lower case l)?
rozyczko
left a comment
There was a problem hiding this comment.
A couple of base.py modules should also be renamed according to the class name inside.
I.e.
sample/assemblies/base.py -> base_assembly.py
sample/elementals/base.py -> base_element.py
Changed folder name to |
Changed class names containing |
Renamed files and extracted base for |
rozyczko
left a comment
There was a problem hiding this comment.
I think this is now ready for mergig.
This PR only consists only code refactoring and typing.
Entry to all sample classes should be fetched directly from
sampleThis is obtained by the
__init__.pyfile in thesamplefolder. By doing so we will be free to make changes to the internal structure of the module in the future.The internal structure of the
samplefolder is now:sampleelementalslayers(layer consists of a material)layerlayer_apmmaterials(most fundamental element)materialmaterial_densitymaterial_mixtureassemblies(these are constructs of layers)gradient_layermultilayerrepeating_multilayersurfactant_layerHowever from a user perspective you would get the
Multilayerclass implemented insample.assemblies.multilayerby executing:from sample import Multiplayeror for
Layerimplemented insample.elementals.layers.layer:from sample import LayerOther Changes
The modules for
materialandlayerbeen split into several files only containing a single class per file.Class renaming:
Structurehas been renamed toSampleLayershas been renamed toLayerCollectionMaterialshas been renamed toMaterialCollectionBase classes introduced in elementals:
BaseElementBaseElementCollectionADR is created in #89