File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 3535ANSYS_DPF_SERVER_CONTEXT=ENTRY and ANSYS_DPF_SERVER_CONTEXT=PREMIUM can be used.
3636"""
3737
38+ from __future__ import annotations
39+
3840from enum import Enum
3941import os
4042import warnings
@@ -264,6 +266,29 @@ def xml_path(self):
264266 """
265267 return self ._xml_path
266268
269+ @xml_path .setter
270+ def xml_path (self , xml_path : str | os .PathLike ):
271+ r"""Set the path to the xml file defining default plugins to load at server start.
272+
273+ Parameters
274+ ----------
275+ xml_path:
276+ Path to the XML file to use at server start. Useful to target a custom XML file.
277+
278+ Examples
279+ --------
280+ Create a ServerContext targeting a custom XML file.
281+
282+ >>> import ansys.dpf.core as dpf
283+ >>> # Create a custom server context
284+ >>> custom_server_context = dpf.AvailableServerContexts.custom_defined
285+ >>> # Set the XML path
286+ >>> custom_server_context.xml_path = r'\path\to\file'
287+ >>> # Start a DPF server using this context
288+ >>> # server = dpf.start_local_server(context=custom_server_context)
289+ """
290+ self ._xml_path = str (xml_path )
291+
267292 def __str__ (self ):
268293 """Return string representation of the ServerContext instance."""
269294 return (
You can’t perform that action at this time.
0 commit comments