AttributeError
HuJinkun opened this issue · 7 comments
Hello, the python 3.7 prompted a error 'AttributeError: module 'spins.invdes.problem_graph.optplan' has no attribute 'BicubicLevelSetParametrization'', when I ran your example that called bend90. Normally, this package should be complete and error-free and I want to know what caused the error. Thanks
Perhaps you didn't reinstall the package again when you downloaded it? I just tried a fresh install and the example seems to run fine.
Perhaps you didn't reinstall the package again when you downloaded it? I just tried a fresh install and the example seems to run fine.
Thank you for your reply. Related dependent packages that show in the file called setup.py were installed by pip command. And then, I downloaded the package to the Disk D and used the command 'python setup.py install' to install it. It showed that spins built the dependence with dependent packages. Is it wrong to install the dependent package included in the key of the dictionary called extras_require directly?
I think you should be able to install the package along with all the correct dependencies using pip install ./spins-b
but what you said should still work.
That said, it is still confusing that it points out BicubicLevelSetParametrization
as missing from optplan
. Can you try a fresh install? BicubicLevelSetParametrization
was added recently, so if you're installed package is old, then it would not find it. If that doesn't work, can you run the following and let me know what you see:
python -c "from spins.invdes.problem_graph import optplan; print(dir(optplan))"
I think you should be able to install the package along with all the correct dependencies using
pip install ./spins-b
but what you said should still work.That said, it is still confusing that it points out
BicubicLevelSetParametrization
as missing fromoptplan
. Can you try a fresh install?BicubicLevelSetParametrization
was added recently, so if you're installed package is old, then it would not find it. If that doesn't work, can you run the following and let me know what you see:python -c "from spins.invdes.problem_graph import optplan;‘’
I think you should be able to install the package along with all the correct dependencies using
pip install ./spins-b
but what you said should still work.That said, it is still confusing that it points out
BicubicLevelSetParametrization
as missing fromoptplan
. Can you try a fresh install?BicubicLevelSetParametrization
was added recently, so if you're installed package is old, then it would not find it. If that doesn't work, can you run the following and let me know what you see:python -c "from spins.invdes.problem_graph import optplan; print(dir(optplan))"
I'm sorry to take up your time for you to check the problem for me.
According to your advice,I try a fresh install. When I install it, warning: install_lib: 'build\lib' does not exist -- no Python modules to install
and Finished processing dependencies for spins==0.2.0
were propmted(Does it mean that I install spins successfully?). Path was manually add by using sys.path.append('D:\ID-Pythoncode\spins-b-master')
. There is no prompt for errors like no module named spins
and AttributeError: module 'spins.invdes.problem_graph.optplan
. And then, I ran the code you gave (python -c "from spins.invdes.problem_graph import optplan;‘’
) through the cmd window and got the following result:
['Abs', 'Any', 'BOUNDARY_CONDITION_TYPES', 'BicubicLevelSetParametrization', 'BlochBoundary', 'Box3d', 'Callable', 'ComplexNumber', 'CompositeParametrization', 'Constant', 'ContToDiscThresholding', 'CreatorFunction', 'CubicParamSigmoidStrength', 'CubicParametrization', 'Dict', 'DiffEpsilon', 'DipoleSource', 'DiscretePenalty', 'EmOverlap', 'EmSource', 'Epsilon', 'EpsilonSpec', 'FabricationConstraint', 'FdfdSimulation', 'FieldMonitor', 'Function', 'GLOBAL_CONTEXT_STACK', 'GaussianSource', 'GdsEps', 'GdsMaterialStack', 'GdsMaterialStackLayer', 'GdsMesh', 'GdsMeshEps', 'GratingEdgeFitTransformation', 'GratingFeatureConstraint', 'GratingParametrization', 'HermiteLevelSetParametrization', 'HermiteParamFixBorder', 'ImportOverlap', 'Initializer', 'List', 'MESH_TYPES', 'Material', 'Mesh', 'Monitor', 'NodeMetaType', 'NormalInitializer', 'OptimizationPlan', 'Optional', 'OptplanContext', 'OptplanContextStack', 'OptplanPolyModelType', 'Overlap', 'ParamEps', 'Parameter', 'Parametrization', 'PecBoundary', 'PenaltyOptimizerOptions', 'PenaltyTransformation', 'PixelParametrization', 'PlaneWaveSource', 'PmcBoundary', 'Power', 'PowerComp', 'ProblemGraphNode', 'Product', 'ReferenceType', 'ScipyOptimizerMonitorList', 'ScipyOptimizerOptions', 'ScipyOptimizerTransformation', 'SelectionMatrixType', 'Set', 'SetParam', 'SimpleMonitor', 'SimulationSpace', 'SimulationSpaceBase', 'SlabMesh', 'Sum', 'Transformation', 'TransformationBase', 'UniformInitializer', 'UniformMesh', 'Union', 'WaveguideMode', 'WaveguideModeEigOverlap', 'WaveguideModeEigSource', 'WaveguideModeOverlap', 'WaveguideModeSource', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'abs', 'autoname', 'context', 'copy', 'define_schema_type', 'dumps', 'enum', 'generate_name', 'io', 'json', 'loads', 'make_constant', 'models', 'numbers', 'optplan', 'problem_graph_name_map', 'register_node', 'register_node_type', 'register_transformation', 'reset_graph', 'schema_em', 'schema_function', 'schema_monitor', 'schema_opt', 'schema_param', 'schema_utils', 'top_level_type', 'types', 'validate', 'validate_references', 'vec2d', 'vec3d', 'warnings']
Does this mean that the previous problem has been solved? But when I ran the bend90.py again, the VScode propmted a new error 'bend90.py: error: the following arguments are required: action, save_folder'.
I think the function you implemented is excellent, so I want to learn more about it. Thank you so much.
Yes, it would appear that your previous problem is resolved.
The example can be run by using
python bend90.py run folder-name
This will run the example and store the results in a folder called "folder-name".
You can view the results with
python bend90.py view folder-name
Hello,I have some problems when I read the example called wdm2. The class called WaveguidemodeOverlap looks like to be used to create an output, but why it has a attribute call power. Lastly, I want to know how to understand the word 'WaveguidemodeOverlap'.Thanks
WaveguideModeOverlap
will perform an overlap integral between the field and a particular waveguide mode (hence the name). power
controls the power of the waveguide mode to use in the overlap integral. Normally we just use unity so that the square magnitude of the overlap corresponds to power, but we left the power
parameter as an option for special applications.