Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Jan 20, 2024
1 parent 57c6a99 commit 3312336
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 25 deletions.
1 change: 1 addition & 0 deletions docs/source/api_bare_metal_compute_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.bare_metal_compute_service
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_cloud_compute_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.cloud_compute_service
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_compute_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.compute_service
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.file
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.simulation
:show-inheritance:
:members:
:exclude-members: add_input_file,add_output_file,create_vm,destroy_vm,get_task_input_files,get_task_output_files,is_vm_down,is_vm_running,is_vm_suspended,lookup_file_at_storage_service,resume_vm,shutdown_vm,standard_job_get_tasks,start_vm,submit_standard_job,supports_compound_jobs,supports_pilot_jobs,supports_standard_jobs,suspend_vm,task_get_end_date,task_get_flops,task_get_max_num_cores,task_get_memory,task_get_min_num_cores,task_get_start_date
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_simulation_item.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ wrench.simulation_item
.. automodule:: wrench.simulation_item
:members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_standard_job.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.standard_job
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_storage_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.storage_service
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.task
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_virtual_machine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.virtual_machine
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
1 change: 1 addition & 0 deletions docs/source/api_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wrench.workflow
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
2 changes: 1 addition & 1 deletion wrench/bare_metal_compute_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, simulation, name: str) -> None:

def submit_standard_job(self, standard_job: StandardJob) -> None:
"""
Submit a standard job to a bare-metal compute service
Submit a standard job to the compute service
:param standard_job: the standard job
:type standard_job: StandardJob
Expand Down
6 changes: 3 additions & 3 deletions wrench/cloud_compute_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, simulation, name: str) -> None:
def create_vm(self, num_cores: int, ram_memory: float, property_list: dict[str, str],
message_payload_list: dict[str, float]) -> VirtualMachine:
"""
Create a new virtual machine instance on a cloud compute service
Create a new virtual machine instance on the compute service
:param num_cores: number of cores in the virtual machine
:type num_cores: int
Expand All @@ -48,7 +48,7 @@ def create_vm(self, num_cores: int, ram_memory: float, property_list: dict[str,

def destroy_vm(self, vm: VirtualMachine) -> None:
"""
Create a new virtual machine instance on a cloud compute service
Destroy a new virtual machine instance on the compute service
:param vm: A virtual machine
:type vm: VirtualMachine
Expand All @@ -57,7 +57,7 @@ def destroy_vm(self, vm: VirtualMachine) -> None:

def __str__(self) -> str:
"""
:return: String representation of a cloud compute service
:return: String representation of a the compute service
:rtype: str
"""
s = f"Compute Service {self.name}"
Expand Down
6 changes: 3 additions & 3 deletions wrench/compute_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, simulation, name: str) -> None:

def supports_compound_jobs(self) -> bool:
"""
Determines whether the compute service supports compound jobs.
Determine whether the compute service supports compound jobs
:return: True if compound jobs are supported, false otherwise
:rtype: bool
Expand All @@ -38,7 +38,7 @@ def supports_compound_jobs(self) -> bool:

def supports_pilot_jobs(self) -> bool:
"""
Determines whether the compute service supports pilot jobs.
Determine whether the compute service supports pilot jobs
:return: True if pilot jobs are supported, false otherwise
:rtype: bool
Expand All @@ -47,7 +47,7 @@ def supports_pilot_jobs(self) -> bool:

def supports_standard_jobs(self) -> bool:
"""
Determines whether the compute service supports standard jobs.
Determine whether the compute service supports standard jobs
:return: True if standard jobs are supported, false otherwise
:rtype: bool
Expand Down
3 changes: 2 additions & 1 deletion wrench/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def get_simulation_events(self) -> List[Dict[str, Union[str, StandardJob, Comput

def create_standard_job(self, tasks: List[Task], file_locations: dict[File, StorageService]) -> StandardJob:
"""
Create a one-task standard job
Create a standard job
:param tasks: list of tasks
:type tasks: List[Task]
Expand Down Expand Up @@ -455,6 +455,7 @@ def create_workflow_from_json(self, json_object: json, reference_flop_rate: str,
ignore_avg_cpu: bool, show_warnings: bool) -> Workflow:
"""
Create a workflow from a JSON file
:param json_object: A JSON object created from a WfCommons JSON file
:type json_object: json
:param reference_flop_rate: reference flop rate
Expand Down
2 changes: 1 addition & 1 deletion wrench/simulation_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def __init__(self, simulation, name: str) -> None:

def get_name(self) -> str:
"""
Get the simulation item name
Get the name
"""
return self.name
2 changes: 1 addition & 1 deletion wrench/standard_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, simulation, name: str, tasks: List[Task]) -> None:

def get_tasks(self) -> List[Task]:
"""
Get the number of tasks in a standard job
Get the list of tasks in the job
:return: a list of task objects
:rtype: List[Task]
Expand Down
4 changes: 2 additions & 2 deletions wrench/storage_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def __init__(self, simulation, name: str) -> None:

def create_file_copy(self, file: File) -> None:
"""
Creates a copy of a file (ex nihilo) at this storage service
Create a copy of a file (ex nihilo) at the storage service
:param file: the file
"""
return self.simulation._create_file_copy_at_storage_service(file, self)

def lookup_file(self, file: File) -> bool:
"""
Checks whether a copy of a file is stored on the storage service
Check whether a copy of a file is stored on the storage service
:param file: the file
:return: true or false
Expand Down
24 changes: 12 additions & 12 deletions wrench/virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class VirtualMachine(SimulationItem):
"""
WRENCH Virtual Machine class.
WRENCH Virtual Machine class
"""

def __init__(self, simulation, cloud_compute_service: CloudComputeService, name: str) -> None:
Expand All @@ -31,7 +31,7 @@ def __init__(self, simulation, cloud_compute_service: CloudComputeService, name:
:type simulation
:param cloud_compute_service: the cloud compute service
:type cloud_compute_service: CloudComputeService
:param name: virtual machine name
:param name: VM name
:type name: str
"""
super().__init__(simulation, name)
Expand All @@ -57,52 +57,52 @@ def start(self) -> BareMetalComputeService:

def suspend(self) -> None:
"""
Suspends a virtual machine.
Suspend the VM
"""
return self.simulation._suspend_vm(self)

def resume(self) -> None:
"""
Resumes a virtual machine.
Resume the VM
"""
return self.simulation._resume_vm(self)

def shutdown(self) -> None:
"""
Shuts down a virtual machine.
Shutdown the VM
"""
return self.simulation._shutdown_vm(self)

def is_running(self) -> bool:
"""
Determines whether a virtual machine is running.
Determine whether the VM is running
:return: True if the virtual machine is running, false otherwise
:return: True if the VM is running, false otherwise
:rtype: bool
"""
return self.simulation._is_vm_running(self)

def is_suspended(self) -> bool:
"""
Determines whether a virtual machine is suspended.
Determine whether the VM is suspended
:return: True if the virtual machine is suspended, false otherwise
:return: True if the VM is suspended, false otherwise
:rtype: bool
"""
return self.simulation._is_vm_suspended(self)

def is_down(self) -> bool:
"""
Determines whether a virtual machine is down.
Determine whether the VM is down
:return: True if the virtual machine is down, false otherwise
:return: True if the VM is down, false otherwise
:rtype: bool
"""
return self.simulation._is_vm_down(self)

def __str__(self) -> str:
"""
:return: String representation of a virtual machine
:return: String representation of the VM
:rtype: str
"""
s = f"Virtual Machine {self.name} on Cloud Compute Service {self.get_cloud_compute_service().get_name()}"
Expand Down
2 changes: 1 addition & 1 deletion wrench/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class Workflow(SimulationItem):
"""
WRENCH Workflow class.
WRENCH Workflow class
"""

def __init__(self, simulation: Simulation, name: str) -> None:
Expand Down

0 comments on commit 3312336

Please sign in to comment.