Trial of an infraction shall be by the court, but when a defendant has been charged with an infraction and with a public offense for which there is a right to jury trial and a jury trial is not waived, the court may order that the offenses be tried together by jury or that they be tried separately with the infraction being tried by the court either in the same proceeding or a separate proceeding as may be appropriate.
Ca. Pen. Code § 1042.5